by Dinesh Thakur

Besides the assignment operator in Java has combined operators assignment. They contribute to reducing the amount of code as impracticable two operations by an operator. The combined operators have the following syntax:



 
by Dinesh Thakur

In this example we reviewed six comparison operator <, <=,>,> =, == And ! =. Comparison operators always produce a boolean result value (true or false). Java has several comparison operator, which can be used for the comparison of any combination of integers, with float or symbols.



 
by Dinesh Thakur

Java has two very useful operators. They are increment (++) and decrement (- -) operators. The increment operator (++) add 1 to the operator value contained in the variable. The decrement operator (- -) subtract from the value contained in the variable.



 
by Dinesh Thakur

The assignment operator (=) is the most commonly used binary operator in Java. It evaluates the operand on the tight hand side and then assigns the resulting value to a variable on the left hand side. The right operand can be a variable, constant, function call or expression. The type of right operand must be type compatible with the left operand. The general form of representing assignment operator is



 
by Dinesh Thakur

Arithmetic operators are used to perform arithmetic calculations. Java provides basic arithmetic operators. They are +,-, *, /, %. The different Arithmetic operators that were used in java programming.



 
by Dinesh Thakur

The break statement terminates the execution of the loop in which it is defined and the control is transferred immediately to the next executable statement after the loop. The break statement is normally used with either while, do-while, for or a switch statement. It is mostly used to exit early from the loop by skipping the remaining statements of loop or switch control structures.

 
by Dinesh Thakur

In addition to the implicit type conversion, Java also provides the facility of explicit type conversion within an expression. In implicit type conversion, a value of lower data type is converted to a value of higher data type. This results in no loss of information. However, if you try to convert a value of higher data type to that of lower data type then java compiler generates an error message "possible loss of precision". For example:



 
by Dinesh Thakur

Most of the computer languages typically support advanced math operations (such as square root, trigonometric sine, cosine etc.) by way of function libraries. Java also provides a range of methods that support such functions in the standard libraries Math class stored in the package java.lang. Java's Math class contains a collection of methods and two constants that compute standard mathematical functions.



 
by Dinesh Thakur

The conversion of a data type which is carried out automatically by the compiler without programmer intervention is called the implicit type conversion. When two variables of different data types are involved in the same expression, the Java compiler uses built-in library functions to trans- form the variables to common data type before evaluating the expression. To decide which variable's data type is to be converted, the Java compiler follows certain rules and converts the lower data type to that of a higher data type. This is known as widening a type.



 
by Dinesh Thakur

Conditional operator (?:) is the only ternary operator available in Java which operates on three operands. The symbol "?" placed between the first and the second operand , and " : " is inserted between the second and third operand. The first operand (or expression) must be a boolean . The conditional operator together with operands form a conditional expression which takes the following form.



 
by Dinesh Thakur

Java provides an extensive bit manipulation operator for programmers who want to communicate directly with the hardware. These operators are used for testing, setting or shifting individual bits in a value. In order to work with these operators, one should be aware of the binary numbers and two's complement format used to represent negative integers.



 
by Dinesh Thakur

Logical operators are used to combine one or more relational expressions that results in formation of complex expressions known as logical expressions. Like relational operators, the logical operators evaluate the result of logical expression in terms of Boolean values that can only be true or false according to the result of the logical expression.

 
by Dinesh Thakur

Relational operators also known as comparison operators are used to check the relation between two operands. In other words, the operators used to make comparisons between two operands are called relational operators. Relational operators are binary operators and hence require two operands. The result of a relational operation is a Boolean value that can only be true or false according to the result of the comparison.

 
by Dinesh Thakur

The Arithmetic operators are used to perform arithmetic operations. The Arithmetic operators are binary operators that work with integers, floating point numbers and even characters (i.e. they can be used with any primitive type except the boolean).

 
by Dinesh Thakur

Here is the Java Example for Area of Triangle



 
by Dinesh Thakur

The left-shift, right-shift, and zero-fill-right-shift operators <<, >>, and >>> shift the individual bits of an integer by a specified integer amount.

 
by Dinesh Thakur

The bitwise AND, OR, and XOR operators (&, |,and /\) all act on the individual bits of an integer. These operators are useful when an integer is being used as a bit field.

 
by Dinesh Thakur

The bitwise complement operator (~), which perform a bitwise negation of an integer value. Bitwise negation means that each bit in the number is toggled. In other words, all the binary 0s become 1s and all the binary 1s become 0s.

 
by Dinesh Thakur

This Java continue statement with label example shows how to use java continue statement to skip to next iteration of the labeled loop.



 
by Dinesh Thakur

Like the break statement, the continue statement also skips the remaining statements of the body of the loop where it is defined but instead of terminating the loop, the control is transferred to the beginning of the loop for next iteration. The loop continues until the test condition of the loop becomes false.

 
by Dinesh Thakur

This Java break statement with label example shows how to use java break statement to terminate the labeled loop.



 
by Dinesh Thakur

This Java break statement example shows how to use java break statement to terminate the loop. The Java break statement has two forms labeled and unlabeled. in the below example You can see unlabeled form.



 
by Dinesh Thakur

Constants :- Constants in java are fixed values those are not changed during the Execution of program java supports several types of Constants  those are  



 
by Dinesh Thakur

Identifiers :- The Identifiers are those which are used for giving a name to a variable  ,class and method ,packages ,interfaces etc There Are Some Rules against for using the Identifiers

 
by Dinesh Thakur

An operator is a symbol which helps the user to command the computer to do a certain mathematical or logical manipulations. Operators are used in Java language program to operate on data and variables. Java has a rich set of operators which can be classified as