- Arithmetic Operators
- Relational Operators
- Bit wise Operators
- Logical Operators
- Assignment Operators
- Misc Operators
- Conditional statements
- If else statement
- Switch statement
if(Expression){statement1}elseif (Expression){statement2}else{statement3(default value)}
2.Iterating statements
- for loop
- while loop
- do while loop
- for each loop
A for loop can be used for executing group of statements multiple times .The for loop should be used when we know the exact number of iterations. go with java online course
All three sections of for loop are optional .we do not initialize and do not specify. The increment and decrements section can contain any valid java statement.
3.Transfer statement- break
- continue
- return
A String object is created by using new operator then the content will be stored in both heap memory and string constant pool but the reference variable will point to the object available in heap memory.
String str = new string (“hello”);If a string object is created by placing a group of characters enclosed directly the pair then the string object can be stored only in string constant pool.String str=”hello” ;Methods of string classThe java.lang.string class gives us a useful methods to perform the functionality of char values.This method will return the count of number of characters available in a string.This method will return in characters that is available at specified index position.
The index position of a string begins with ‘0’ if we specify the index value outside the range then we get called run time error called “String Index Out Of Bond Exeception”.
String Buffer:String Buffer is a predefined class used for storing group of characters, the object can be created only in one way that is using new operator.String Buffer Methods:String Builder:String Builder is a predefined class used for storing characters, the string builder is a class introduced in java 5 version, the objects are created only in one way that is by using new operator.
String Builder sb=new String Builder (“hello friends”);
Array:
An application requires multiple values then we can store those multiple values by declaring multiple variables, if an application contain multiple variables then the code size will be increased and maintenance will be difficult.
The arrays are classified into two types- Single dimension array
- Multi dimension array