# Quiz Discussion

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

Course Name: Java

• 1]

Integers

• 2]

Floating – point numbers

• 3]

Boolean

• 4]

None of the mentioned

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

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

• 1]

true

• 2]

false

##### Solution
2
Discuss

What will be the output of the following Java program?

    class increment
{
public static void main(String args[])
{
double var1 = 1 + 5;
double var2 = var1 / 4;
int var3 = 1 + 5;
int var4 = var3 / 4;
System.out.print(var2 + " " + var4);

}
}

• 1]

1 1

• 2]

0 1

• 3]

1.5 1

• 4]

1.5 1.0

##### Solution
3
Discuss

Which of the following can be operands of arithmetic operators?

• 1]

Numeric

• 2]

Boolean

• 3]

Characters

• 4]

Both Numeric & Characters

##### Solution
4
Discuss

What will be the output of the following Java code?

    class Output
{
public static void main(String args[])
{
boolean a = true;
boolean b = false;
boolean c = a ^ b;
System.out.println(!c);
}
}

• 1]

0

• 2]

1

• 3]

true

• 4]

false

##### Solution
5
Discuss

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

• 1]

1

• 2]

32

• 3]

33

• 4]

31

##### Solution
6
Discuss

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

• 1]

~

• 2]

<<<

• 3]

>>>

• 4]

^

##### Solution
7
Discuss

Decrement operator, −−, decreases the value of variable by what number?

• 1]

1

• 2]

2

• 3]

3

• 4]

4

##### Solution
8
Discuss

Modulus operator, %, can be applied to which of these?

• 1]

Integers

• 2]

Floating – point numbers

• 3]

Both Integers and floating – point numbers

• 4]

None of the mentioned

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

# Quiz