Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ch.fhnw.claudemartin;
- import java.util.function.IntBinaryOperator;
- public class SomeClass {
- static {
- System.out.println("SomeClass: static initializer block");
- }
- {
- System.out.println("SomeClass: initializer block (non-static)");
- }
- int i = ((IntBinaryOperator) ((a, b) -> {
- System.out.println("SomeClass: lambda expression");
- return a + b;
- })).applyAsInt(15, 27);
- public SomeClass() {
- super();// super ct'r before the following code!
- System.out.println("SomeClass: constructor");
- }
- public static void main(final String[] args) {
- System.out.println("SomeClass: start");
- new SomeClass();
- new InnerClass();
- System.out.println("SomeClass: end");
- }
- public static class InnerClass extends SomeClass {
- static {
- System.out.println("InnerClass: static initializer block");
- }
- {
- System.out.println("InnerClass: initializer block (non-static)");
- }
- int i = ((IntBinaryOperator) ((a, b) -> {
- System.out.println("InnerClass: lambda expression");
- return a + b;
- })).applyAsInt(24, 67);
- public InnerClass() {
- super();// super ct'r before the following code!
- System.out.println("InnerClass: constructor");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement