by Dinesh Thakur
Category: Operators and Expressions

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
Category: Operators and Expressions

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
Category: Operators and Expressions

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
Category: Operators and Expressions

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
Category: Operators and Expressions

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
Category: Operators and Expressions

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
Category: Operators and Expressions

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
Category: Operators and Expressions

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
Category: Operators and Expressions

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
Category: Operators and Expressions

**Here is the Java Example for **Area of Triangle

by Dinesh Thakur
Category: Operators and Expressions

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
Category: Operators and Expressions

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
Category: Operators and Expressions

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
Category: Operators and Expressions

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
Category: Operators and Expressions

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
Category: Operators and Expressions

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

by Dinesh Thakur
Category: Operators and Expressions

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
Category: Operators and Expressions

**Constants**: Constants in java are fixed values those are not changed during the Execution of program. A literal is a constant value that can be classified as integer literals, string literals and boolean literals. To make a static field constant in Java, make a variable as both static and final. java supports several types of Constants those are

by Dinesh Thakur
Category: Operators and Expressions

**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
Category: Operators and Expressions

An operator is a special symbol that tells the compiler to perform a specific mathematical or logical operation on one or more operands where an operand can be an expression. An operation is an action(s) performed on one or more operands that evaluates mathematical expressions or change the data.

About Dinesh Thakur

Dinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular Computer Notes blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.

Basic Courses

Advance Courses