Java - Language Fundamentals

Java - Language Fundamentals
11. Which one is a valid declaration of a boolean?
  • boolean b1 = 0;
  • boolean b2 = 'false';
  • boolean b3 = false;
  • boolean b4 = Boolean.false();
Show Answer
12. Which three are valid declarations of a float?

    float f1 = -343;
    float f2 = 3.14;
    float f3 = 0x12345;
    float f4 = 42e7;
    float f5 = 2001.0D;
    float f6 = 2.81F;
  • 1, 2, 4
  • 2, 3, 5
  • 1, 3, 6
  • 2, 4, 6
Show Answer
13. Which is a valid declarations of a String?
  • String s1 = null;
  • String s2 = 'null';
  • String s3 = (String) 'abc';
  • String s4 = (String) '\ufeed';
Show Answer
14. What is the numerical range of a char?
  • -128 to 127
  • -(215) to (215) - 1
  • 0 to 32767
  • 0 to 65535
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test