# Quiz Discussion

Which of these operators can skip evaluating right hand operand?

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]

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

What will be the output of the following Java program?

    class Output
{
public static void main(String args[])
{
int a = 1;
int b = 2;
int c = 3;
a |= 4;
b >>= 1;
c <<= 1;
a ^= c;
System.out.println(a + " " + b + " " + c);
}
}

• 1]

3 1 6

• 2]

2 2 3

• 3]

2 3 4

• 4]

3 3 6

##### Solution
3
Discuss

Which right shift operator preserves the sign of the value?

• 1]

<<

• 2]

>>

• 3]

<<=

• 4]

>>=

##### Solution
4
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
5
Discuss

What will be the output of the following Java program?

class Output
{
public static void main(String args[])
{
int a,b,c,d;
a=b=c=d=20
a+=b-=c*=d/=20
System.out.println(a+" "+b+" "+c+" "+d);

}
}

• 1]

compile time error

• 2]

runtime error

• 3]

a=20 b=0 c=20 d=1

• 4]

none of the mentioned

##### Solution
6
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
7
Discuss

Which of the following operators can operate on a boolean variable?

   1. &&
2. ==
3. ?:
4. +=
• 1]

3 & 2

• 2]

1 & 4

• 3]

1, 2 & 4

• 4]

1, 2 & 3

##### Solution
8
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
9
Discuss

What will be the output of the following Java program?

    class Output
{
public static void main(String args[])
{
int a = 1;
int b = 2;
int c;
int d;
c = ++b;
d = a++;
c++;
b++;
++a;
System.out.println(a + " " + b + " " + c);
}
}

• 1]

3 2 4

• 2]

3 2 3

• 3]

2 3 4

• 4]

3 4 4

##### Solution
10
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

# Quiz