Jump Statements : Jump statements are used to transfer the flow of control from one part of the program to another part of the program.
a) break: break statement is used to transfer the flow of control out of the loop or out of the switch .
b) continue: continue statement transfer the flow of control to the next iteration part in for loop and transfer the control in the starting of the loop in case of while and do...while.
c) return: return statement are used to transfer the flow of control from function to it calling part. It can be used to return a value.
d) System.exit(0) : It is used to terminate the execution of program.
Scope and visibility:
The Scope of an identifier is the part of the program in which that identifier is valid i.e. accessible.
The scope of the variable exist in the block in which it is created.
The visibility rules come into action when the variables with the same name are defined in different scope.
Access specifier
- public : public members are accessible with in the class and outside the class in the same package and any other package also.
- Private members are accessible only inside their own class and nowhere else.
- protected members are accessible inside their own class, sub class and package.
- The default(friendly or package) members are accessible inside their class as well to the classes in the same package.The default access specifier is friendly which is not a keyword.
Note : default member can’t be used outside the package while public can be used.

0 Comments