&& operator in Java with Examples Last Updated : 30 Sep, 2019 Comments Improve Suggest changes Like Article Like Report && is a type of Logical Operator and is read as "AND AND" or "Logical AND". This operator is used to perform "logical AND" operation, i.e. the function similar to AND gate in digital electronics. One thing to keep in mind is the second condition is not evaluated if the first one is false, i.e. it has a short-circuiting effect. Used extensively to test for several conditions for making a decision. Syntax: Condition1 && Condition2 // returns true if both the conditions are true. Below is an example to demonstrate && operator: Example: Java // Java program to illustrate // logical AND operator import java.util.*; public class operators { public static void main(String[] args) { int num1 = 10; int num2 = 20; int num3 = 30; // find the largest number // using && operator if (num1 >= num2 && num1 >= num3) System.out.println( num1 + " is the largest number."); else if (num2 >= num1 && num2 >= num3) System.out.println( num2 + " is the largest number."); else System.out.println( num3 + " is the largest number."); } } Output: 30 is the largest number. Comment More infoAdvertise with us Next Article && operator in Java with Examples C code_r Follow Improve Article Tags : Java Java-Operators Practice Tags : JavaJava-Operators Similar Reads & Operator in Java with Examples The & operator in Java has two definite functions: As a Relational Operator: & is used as a relational operator to check a conditional statement just like && operator. Both even give the same result, i.e. true if all conditions are true, false if any one condition is false. However, 2 min read Java Assignment Operators with Examples Operators constitute the basic building block of any programming language. Java too provides many types of operators which can be used according to the need to perform various calculations and functions, be it logical, arithmetic, relational, etc. They are classified based on the functionality they 7 min read Java Arithmetic Operators with Examples Operators constitute the basic building block to any programming language. Java too provides many types of operators which can be used according to the need to perform various calculations and functions, be it logical, arithmetic, relational, etc. They are classified based on the functionality they 6 min read Java Unary Operator with Examples Operators constitute the basic building block to any programming language. Java too provides many types of operators which can be used according to the need to perform various calculations and functions be it logical, arithmetic, relational, etc. They are classified based on the functionality they p 8 min read Java Logical Operators with Examples Logical operators are used to perform logical "AND", "OR", and "NOT" operations, i.e., the functions similar to AND gate and OR gate in digital electronics. They are used to combine two or more conditions/constraints or to complement the evaluation of the original condition under particular consider 8 min read Like