Java - Language Fundamentals Questions and Answers
Java Language Fundamentals questions with answers are essential for mastering the building blocks of Java programming. This includes topics like data types, operators, arrays, and control structures. Practicing programming questions and answers with explanations enables students to improve coding accuracy and logical reasoning. These Java MCQs are widely asked in technical interviews and online coding assessments conducted by companies like Infosys, TCS, and Capgemini. Reviewing Java aptitude questions with solutions PDF helps solidify your understanding of syntax and execution flow for placement and certification exams.
Java - Language Fundamentals
Showing 10 of
14 questions
11. Which one is a valid declaration of a boolean?
- boolean b1 = 0;
- boolean b2 = 'false';
- boolean b3 = false;
- boolean b4 = Boolean.false();
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
13. Which is a valid declarations of a String?
- String s1 = null;
- String s2 = 'null';
- String s3 = (String) 'abc';
- String s4 = (String) '\ufeed';
14. What is the numerical range of a char?
- -128 to 127
- -(215) to (215) - 1
- 0 to 32767
- 0 to 65535