Skip to content

Commit 2b6ad5b

Browse files
authored
Add files via upload
1 parent 7666b51 commit 2b6ad5b

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
class Blocks{
2+
//creating an anonymous blocks
3+
{
4+
System.out.println("Inside Anonymous Block");
5+
}
6+
//creating a static block
7+
static{
8+
System.out.println("Inside Static Block");
9+
}
10+
11+
//creating constructor of class
12+
Blocks(){
13+
System.out.println("Inside Constructor");
14+
}
15+
}
16+
class OrderOfExecution{
17+
//creating an object of class blocks
18+
public static void main(String args[]){
19+
Blocks obj=new Blocks();
20+
System.out.println("**************");
21+
//creating another object of class Blocks
22+
Blocks obj1=new Blocks();
23+
}
24+
}

0 commit comments

Comments
 (0)