Advertisement
Guest User

Untitled

a guest
Nov 20th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. class A {
  2.  
  3.     {
  4.         System.out.println("A Brace");
  5.     }
  6.  
  7.     static {
  8.         System.out.println("A Static Brace");
  9.     }
  10.  
  11.     public A() {
  12.         System.out.println("A Constructor");
  13.     }
  14.  
  15. }
  16.  
  17. class B extends A {
  18.     {
  19.         System.out.println("B Brace");
  20.     }
  21.  
  22.     static {
  23.         System.out.println("B Static Brace");
  24.     }
  25.  
  26.     public B() {
  27.         super();
  28.  
  29.         System.out.println("B Constructor");
  30.     }
  31. }
  32.  
  33. public class Main {
  34.     public static void main(String[] args) throws InterruptedException {
  35.         System.out.println("Enter main");
  36.  
  37.         B b = new B();
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement