What will be printed?
boolean value = Double.NaN == Double.NaN;
System.out.println(value);
Answer
What will be printed?
boolean value = -0.0 == 0.0;
System.out.println(value);
Answer
What will be printed?
double value = -0.0;
System.out.println(value);
Answer
What will be printed?
int i = 255;
byte b = (byte) i;
System.out.println(b);
Answer
What is wrong with this code?
public String readLine() {
try {
BufferedReader br =
new BufferedReader(new FileReader("file.txt"));
String line = br.readLine();
br.close();
return line;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Answer
What is the outcome?
int value = (int) 2.0 / 3.0;
System.out.println(value);
Answer
What will be printed?
double value = 2 / 3;
System.out.println(value);
Answer
© 2017 QuizBucket.org