# Quiz Discussion

On applying Left shift operator, <<, on integer bits are lost one they are shifted past which position bit?

Course Name: Java

• 1]

1

• 2]

32

• 3]

33

• 4]

31

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

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
2
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
3
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
4
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
5
Discuss

Which of the following can be operands of arithmetic operators?

• 1]

Numeric

• 2]

Boolean

• 3]

Characters

• 4]

Both Numeric & Characters

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

What is the value stored in x in the following lines of Java code?

   int x, y, z;
x = 0;
y = 1;
x = y = z = 8;
• 1]

0

• 2]

1

• 3]

9

• 4]

8

##### Solution
8
Discuss

What is the output of relational operators?

• 1]

Integer

• 2]

Boolean

• 3]

Characters

• 4]

Double

##### Solution
9
Discuss

Which of these statements are incorrect?

• 1]

Assignment operators are more efficiently implemented by Java run-time system than their equivalent long forms

• 2]

Assignment operators run faster than their equivalent long forms

• 3]

Assignment operators can be used only with numeric and character data type

• 4]

None of the mentioned

##### Solution
10
Discuss

What will be the output of the following Java code?

    class operators
{
public static void main(String args[])
{
int var1 = 5;
int var2 = 6;
int var3;
var3 = ++ var2 * var1 / var2 + var2;
System.out.print(var3);
}
}

• 1]

10

• 2]

11

• 3]

12

• 4]

56

# Quiz