Access Modifiers
Access Modifiers
CLAN JAVA
PROGRAMMING
CLUB
In Java, Access modifiers help to restrict the scope of a class, constructor,
variable, method, or data member. It provides security, accessibility, etc to the
user depending upon the access modifier used with the element.
•The public access modifier has the widest scope among all other access
modifiers.
•Classes, methods, or data members that are declared as public are accessible
from everywhere in the program. There is no restriction on the scope of
public data members.
CONTROL STATEMENTS
Loop statements
Jump statements
DECISION MAKING
1.Simple if statement
2.if-else statement
3.if-else-if ladder
4.Nested if-statement
1) Simple if statement:
It is the most basic statement among all control flow statements in Java.
It evaluates a Boolean expression and enables the program to enter a block of code
if the expression evaluates to true.
2. if-else statement
The if-else statement is an extension to the if-statement, which uses another block
of code, i.e., else block.
The else block is executed if the condition of the if-block is evaluated as false.
3) if-else-if ladder:
In other words, we can say that it is the chain of if-else statements where the
program may enter in the block of code where the condition is true.
Afza Fathima
Gunaseelan R
Final Year Dept of Information Technology
8838965059