JAVA QUIZ
1 .
What will be printed
int a = -1;
a = a >> 1;
System.out.println(a);​

Correct Answer : Option (A)

-1
  Show Answer
2 .
What will be the output of following piece of code? ? 
public class operatorExample { 
    public static void main(String args[]) { 
    int x=4; System.out.println(x++);
    }
 }
​

Correct Answer : Option (D)

output=4 
  Show Answer
3 .
What will be the output of Round(3.7).

Correct Answer : Option (A)

4
  Show Answer
4 .
Which Keyword is used If a class has multiple constructors defined,it's possible to call a constructor from another constructor’s body?

Correct Answer : Option (C)

this()
  Show Answer
5 .
What will be printed?
byte b = (byte) 128;
b >>>= 1;
System.out.println(b);​

Correct Answer : Option (A)

-64
  Show Answer
6 .
What will be printed?
int a = 1;
a += ++a * a;
System.out.println(a);​

Correct Answer : Option (C)

  Show Answer
7 .
Which of the following is true?
public final class Main {

  static final String s = "hello";

  public void main(String[] args) {
    System.out.println(s);
  }

}

Correct Answer : Option (B)

The code will fail at run time
  Show Answer
8 .
Which of these statements is true about both Abstract Classes and Interfaces?

Correct Answer : Option (D)

Abstract classes can define methods but Interfaces can only delcare methods           -(D)
  Show Answer
9 .
What is the output of the following code?
String x = "John Doe";
System.out.println("'"+x.substring(5)+"'");

Correct Answer : Option (C)

'Doe' 
  Show Answer
10 .
What gets printed?
String a = "Hello";
String b = " Hello ";
System.out.println(a.equals(b));

Correct Answer : Option (D)

false
  Show Answer