Quiz Discussion

Which of these have highest precedence?

Course Name: Java

  • 1]

    ()

  • 2]

    ++

  • 3]

    *

  • 4]

    >>

Solution
No Solution Present Yet

Top 5 Similar Quiz - Based On AI&ML

Quiz Recommendation System API Link - https://fresherbell-quiz-api.herokuapp.com/fresherbell_quiz_api

# Quiz
1
Discuss

Which of these is not a bitwise operator?

  • 1]

    &

  • 2]

    &=

  • 3]

    |=

  • 4]

    <=

Solution
2
Discuss

Which operator is used to invert all the digits in a binary representation of a number?

  • 1]

    ~

  • 2]

    <<<

  • 3]

    >>>

  • 4]

    ^

Solution
3
Discuss

What will be the output of the following Java program?

    class Modulus 
    {
        public static void main(String args[]) 
        {    
             double a = 25.64;
             int  b = 25;
             a = a % 10;
             b = b % 10;
             System.out.println(a + " "  + b);
        } 
    }

 

  • 1]

    5.640000000000001 5

  • 2]

    5.640000000000001 5.0

  • 3]

    5 5

  • 4]

    5 5.640000000000001

Solution
4
Discuss

What will be the output of the following Java code?

    class Relational_operator 
    {
        public static void main(String args[])
        {
            int var1 = 5; 
            int var2 = 6;
            System.out.print(var1 > var2);
        } 
    }

 

  • 1]

    1

  • 2]

    0

  • 3]

    true

  • 4]

    false

Solution
5
Discuss

Which of these statements are incorrect?

  • 1]

    Equal to operator has least precedence

  • 2]

    Brackets () have highest precedence

  • 3]

    Division operator, /, has higher precedence than multiplication operato

  • 4]

    Addition operator, +, and subtraction operator have equal precedence

Solution
6
Discuss

What will be the output of the following Java code?

    class operators 
    {
        public static void main(String args[]) 
        {    
             int x = 8;
             System.out.println(++x * 3 + " " + x);
        } 
    }

 

  • 1]

    24 8

  • 2]

    24 9

  • 3]

    27 8

  • 4]

    27 9

Solution
7
Discuss

Which of these is returned by “greater than”, “less than” and “equal to” operators?

  • 1]

    Integers

  • 2]

    Floating – point numbers

  • 3]

    Boolean

  • 4]

    None of the mentioned

Solution
8
Discuss

What will be the output of the following Java program?

    class bitwise_operator 
    {
        public static void main(String args[])
        {
            int var1 = 42;
            int var2 = ~var1;
            System.out.print(var1 + " " + var2);     	
        } 
    }

 

  • 1]

    42 42

  • 2]

    43 43

  • 3]

    42 -43

  • 4]

    42 43

Solution
9
Discuss

What will be the output of the following Java code?

    class bool_operator 
    {
        public static void main(String args[]) 
        {    
             boolean a = true;
             boolean b = !true;
             boolean c = a | b;
 	     boolean d = a & b;
             boolean e = d ? b : c;
             System.out.println(d + " " + e);
        } 
    }

 

  • 1]

    false false

  • 2]

    true ture

  • 3]

    true false

  • 4]

    false true

Solution
10
Discuss

Which of the following can be operands of arithmetic operators?

  • 1]

    Numeric

  • 2]

    Boolean

  • 3]

    Characters

  • 4]

    Both Numeric & Characters

Solution
# Quiz