Skip to content

Tag Archives: Java-Operators

&& is a type of Logical Operator and is read as “AND AND” or “Logical AND“. This operator is used to perform “logical AND” operation,… Read More
In C and C++, comma (, ) can be used in two contexts: Comma as an operator Comma as a separator But in this article,… Read More
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… Read More
Many programmers believe that the statement “x += i” is simply a shorthand for “x = x + i”. This isn’t quite true. Both of… Read More
Compound-assignment operators provide a shorter syntax for assigning the result of an arithmetic or bitwise operator. They perform the operation on the two operands before… Read More
Find the output of the program public class GFG {     public static void main(String[] args) {     char x = 'X';     int i = 0;     System.out.print(true… Read More
Java provides many types of operators which can be used according to the need. They are classified based on the functionality they provide. Some of… Read More
Predict the output of the following program. class Test {     boolean[] array = new boolean[3];     int count = 0;        void set(boolean[] arr, int x)… Read More
class demo {     int a, b, c;     demo(int a, int b, int c)     {         this.a = a;         this.b = b;     }            demo()     {         a… Read More
class Test {     public static void main(String args[])     {         String s1 = "geeksquiz";         String s2 = "geeksquiz";         System.out.println("s1 == s2 is:" + s1 == s2);… Read More
class Base {}    class Derived extends Base {    public static void main(String args[]){       Base a = new Derived();       System.out.println(a instanceof Derived);    } } (A)… Read More
Which of the following is not an operator in Java? (A) instanceof (B) sizeof (C) new (D) >>>= Answer: (B) Explanation: There is no sizeof… Read More
class Test {     public static void main(String args[])  {        System.out.println(10*20 + "GeeksQuiz");        System.out.println("GeeksQuiz" + 10*20);    }  } (A) 10*20GeeksQuiz GeeksQuiz10*20 (B) 200GeeksQuiz GeeksQuiz200 (C) 200GeeksQuiz… Read More
class Test {     public static void main(String args[])  {        System.out.println(10  +  20 + "GeeksQuiz");         System.out.println("GeeksQuiz" + 10 + 20);     }   } (A) 30GeeksQuiz GeeksQuiz30 (B)… Read More
Predict the output of following Java program. Assume that int is stored using 32 bits. class Test {     public static void main(String args[])  {        int… Read More

Start Your Coding Journey Now!