Iteration Statement in JAVA

When you want a part of the code to execute repeatedly and terminate when some condition satisfies, then iteration statements, generally known as loops are used. JAVA's iteration statements are for, while, do-while. while  while loop is fundamental looping statement. It repeats the statements or block until the controlling expression is true. It is an entry... Continue Reading →

Bitwise Operator

There are six types of Bitwise operators : & (AND), | (OR) , ^ (X -OR), ~ (COMPLIMENT) , >> (RIGHT SHIFT) , << (LEFT SHIFT) All the operators will not modify the operands.   >  Now let us understand the difference between logical AND, OR and Bitwise AND, OR. In Logical operations, compiler will check... Continue Reading →

Selection Statements in JAVA

As we discussed JAVA has mainly two types of selection statements:  if and switch.  Both the statements can be used to control the flow of your program's execution, whatever is the condition at runtime.let's have closer look 😀 Let's have closer look 😀 if Statement if statement is JAVA's conditional branch statement used to route the program... Continue Reading →

Logical Operator

There are three types of logical operators: AND (&&), OR(||) and NOT(!) Out of these AND and OR are binary, whereas NOT is a unary operator. AND (&&): OR (||): NOT (!): In the above illustrations we saw truth table of AND, OR and NOT logical operators. Now we will take an example and try... Continue Reading →

Control Statements in JAVA

If you are familiar with C, C++ control statements then it will be easier for you to understand the control statements here and if not then also it will be easier to understand 😉 So let's have a closer look. JAVA has three types of control statements: Selection Statement Iteration Statement Jump Statement In Selection Statement, ... Continue Reading →

Sizeof() Operator

Sizeof() Operator is useful for finding the size of a variable or finding the size of the datatype. The unary operator only needs 1 operand to perform a task. Example : main() { int i = 10; printf("%d %d %d",sizeof(int),sizeof(i),sizeof(10)); }   Answer: 4  4  4 2. main() { int i = 10; printf("%d %d... Continue Reading →

Relational Operator

Relational operator is Binary, it needs two operands to perform the task. It will give output as a 0 (False) and 1 ( True). Both sides of the relational operator should be constant or a variable. It will not modify the operands. Example : 10 < 20; i > j; i > 20; 20 >... Continue Reading →

Assignment Operator

We will take one example : i = 10 ; i = j ; Note that right side of assignment operator should be a variable or a constant. ex : 10 = i ; ->Above iteration is totally wrong you cannot write like that. ->This is called " L- value Error " Implicit and Explicit... Continue Reading →

Powered by WordPress.com.

Up ↑