-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScope.java
More file actions
41 lines (40 loc) · 851 Bytes
/
Scope.java
File metadata and controls
41 lines (40 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
class Scop
{
Scop(int x)
{
System.out.println("constructor with argument"+x);
}
Scop()
{
System.out.println("Constructor without arument");
}
static
{
System.out.println("first static block");
}
{
System.out.println("not static not a constructor");
}
static
{
System.out.println("second static block");
}
void scope1(){
System.out.println("Scope1");
}
}
class Scope
{
public static void main(String[] args)
{
System.out.println("First");
Scop obj;
System.out.
("Second");
obj=new Scop();
System.out.println("Third");
obj.scope1();
System.out.println("end of default");
Scop obj1=new Scop(5);
}
}