-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInstanceControl1.java
More file actions
39 lines (32 loc) · 861 Bytes
/
InstanceControl1.java
File metadata and controls
39 lines (32 loc) · 861 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
/*
Instance control flow is as follows:
1. Static Control flow.
2. Identification of instance members from top to bottom. [3-8]
3. Execution of instance variable assignment & instance blocks from top to bottom. [9-14]
4. Execution of constructor. [15]
*/
class InstanceControl1
{
int i=10; //3, 9
{ //4
mth(); //10
System.out.println("first instance block"); //12
}
InstanceControl() //5
{
System.out.println("constructor"); //15
}
public static void main(String[]args) //1
{
InstanceControl1 i= new InstanceControl1(); //2,15 //if we comment this line then output will be: main
System.out.println("main"); //16
}
public void mth() //6
{
System.out.println(j); //11
}
{ //7
System.out.println("second instance block");} //13
}
int j=20; //8, 14
}