Quiz Discussion

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

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 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
2
Discuss

What will be the output of the following Java program?

    class leftshift_operator 
    {
        public static void main(String args[]) 
        {        
             byte x = 64;
             int i;
             byte y; 
             i = x << 2;
             y = (byte) (x << 2)
             System.out.print(i + " " + y);
        } 
    }

 

  • 1]

    0 64

  • 2]

    64 0

  • 3]

    0 256

  • 4]

    256 0

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 Output 
{
        public static void main(String args[]) 
        {    
             int x=y=z=20;
 
        } 
}

 

  • 1]

    compile and runs fine

  • 2]

    20

  • 3]

    run time error

  • 4]

    compile time error

Solution
5
Discuss

What is the order of precedence (highest to lowest) of following operators?

    1. &    
    2. ^
    3. ?:
  • 1]

    1 -> 2 -> 3

  • 2]

    2 -> 1 -> 3

  • 3]

    3 -> 2 -> 1

  • 4]

    2 -> 3 -> 1

Solution
6
Discuss

Can 8 byte long data type be automatically type cast to 4 byte float data type?

  • 1]

    true

  • 2]

    false

Solution
7
Discuss

Which of these is not a bitwise operator?

  • 1]

    &

  • 2]

    &=

  • 3]

    |=

  • 4]

    <=

Solution
8
Discuss

Which of these statements are incorrect?

  • 1]

    The left shift operator, <<, shifts all of the bits in a value to the left specified number of times

  • 2]

    The right shift operator, >>, shifts all of the bits in a value to the right specified number of time

  • 3]

    The left shift operator can be used as an alternative to multiplying by 2

  • 4]

    The right shift operator automatically fills the higher order bits with 0

Solution
9
Discuss

Which of these statements is correct?

  • 1]

    true and false are numeric values 1 and 0

  • 2]

    true and false are numeric values 0 and 1

  • 3]

    true is any non zero value and false is 0

  • 4]

    true and false are non numeric values

Solution
10
Discuss

What will be the output of the following Java program?

    class bitwise_operator 
    {
        public static void main(String args[]) 
        {    
             int a = 3;
             int b = 6;
 	         int c = a | b;
             int d = a & b;             
             System.out.println(c + " "  + d);
        } 
    }

 

  • 1]

    7 2

  • 2]

    7 7

  • 3]

    7 5

  • 4]

    5 2

Solution
# Quiz