Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Main3 {
- public static void main(String[] args) {
- C c = new C();
- }
- }
- class C extends B {
- static {
- System.out.println("From static C");
- }
- {
- System.out.println("From non-static C");
- }
- C() {
- System.out.println("From constructor C");
- }
- }
- class B extends A {
- static {
- System.out.println("From static B");
- }
- {
- System.out.println("From non-static B");
- }
- B() {
- System.out.println("From constructor B");
- }
- }
- class A {
- static {
- System.out.println("From static A");
- }
- {
- System.out.println("From non-static A");
- }
- A() {
- System.out.println("From constructor A");
- }
- }
Add Comment
Please, Sign In to add comment