Java Operators | Ternary OperatorJava Operators are symbols those are useful to perform certain operations. In other words, Java Operators are objects that perform specific actions on particular values and find the result. They help in performing operations. There are different types of Java operators like Java ternary operator, arithmetic operator, Increment and Decrement operator, Modulus operator, boolean logical operator, relational operator, Short circuit logical operator, assignment operator and bitwise operator. All these classifications of Java operators can be used in different types of operations.For example take the expression, 24+14*50. Where +, * are the Java operators and 24, 14, 50 are the operands in Java. According to the operation, the no.of operands will be vary for every Java operator. There are two operands for addition operator and there is only one operand for unary operator; but for Java ternary operator, there are three operands. In Java operators, ternary operator is the only operator which contains three operands. Java ternary operator is also known as Conditional Operator. This Java ternary operator is useful for evaluating boolean expressions. The main purpose of this ternary operator is to determine which value should be assign to the variable. Java ternary operator uses the symbol '? :'. It completely works like a if-else statement. Boolean expression is the first operand in this ternary operator. If the condition is true then second operand value will be assigned to the variable otherwise the third operand value will be assigned. So, Java ternary operator is useful for replacing if_then_else statements. In this chapter, we can also learn about Arithmetic operator, Increment and Decrement operator, Modulus operator, Boolean logical operator, Relational operator, Short circuit logical operator, Assignment operator, Operator Precedence And Associativity in detail at below. In this Java Operators section, we'll go into detail about: 4.1 Operators In Java
4.2 Java Arithmetic Operators
4.3 Basic Arithmetic Operators In Java
4.4 Increment And Decrement Operators In Java
4.5 Modulus Operator In Java
4.6 Arithmetic Compound Assignment Operators In Java
4.7 Relational Operators In Java
4.8 Boolean Logical Operators In Java
4.9 Short Circuit Logical Operators In Java
4.10 Assignment Operator In Java
4.11 Java Ternary Operator
4.12 Java Operator Precedence And Associativity
4.13 Temperature Conversion Program In Java
Dependent Topics : 3. Variables |