Instance Control Flow
Instance Control Flow decides the sequence of activities that will be executed in order when we run a java class that contains instance variables, methods, and blocks.
Process of instance control flow
Instance control flow will execute at the time of object creation the following is the sequence of statements which will execute at the time of object creation.
1. Identification of Instance members
i = 0 (RIWO) Read Indirect Write Only
j = 0 (RIWO)
2. Execution of Instance variable assignments and Instance block from top to bottom
i = 0 (R & W)
j = 0 (R & W)
3. Execution of Main Method.
Static control flow is only one time activity and that will execute at the time of class loading. But instance control flow is not one time activity. And it will execute for every object creation separately.
If the variable is in RIWO state then we r not allowed to perform read operation directly, violation leads to C.E Saying “Illegal forward reference”.