Data Types in Java - MCQ Questions with Answers - Core Java Quiz
Questions
1
Which of the following is not an valid declaration of an array?
Answer: Option [D]
In multidimensional array rows cannot left blank.
2
String.ValueOf('r').concat("def").concat(String.ValueOf('2'))
Answer: Option [B]
⭐ Make GKSeries Your Preferred Source on Google
Add GKSeries as Preferred Source
3
Which of the following is correct statement?
Answer: Option [C]
Constants are not directly supported by Java. The reserved 'Final' is used to declare constant.
4
Size of an integer can be
Answer: Option [A]
Int takes 4 bytes i.e. 32bits. 1 bit is reserved to store sign.
5
For which of the following data types the ValueOf() method is NOT overloaded in the string class?
Answer: Option [D]
For all Java built in types ValueOf() method is overloaded within the String. valueOf() method returns the string representation of the corresponding arguments value.