JOIN ADRE 2.0 Telegram Group

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?
A int [ ] a = new int [3];
B int a [ ] [ ] = new int [3] [3]
C int [ ] [ ] a = new int [3] [ ];
D int [ ] [ ] a = new int [ ] [3];

Answer: Option [D]

In multidimensional array rows cannot left blank.

2 String.ValueOf('r').concat("def").concat(String.ValueOf('2'))
A 0
B 1
C 3
D 4

Answer: Option [B]
Advertisement
ADRE 2.0 Mock Test - 5 Start Test
ADRE 2.0 Mock Test - 5 Start Test

DOWNLOAD CURRENT AFFAIRS PDF FROM APP

3 Which of the following is correct statement?
A Boolean true value is 1 and false value is 0
B Every private class has a wrapper class
C Constant identifier precede with a reserved word final
D System.out.println() method also flushes the buffer

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
A -231 to 231-1
B 0 to -216
C -28 to 28-1
D -215 to 215-1

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?
A Float
B Boolean
C Object
D None of these

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.

ADRE 2.0 MOCK TEST

Take Mock Tests

Government Schemes Mock Test Start Test!
Political Science Mock Test – 42 Start Test
History Test – 190 Start Test
Quantitative Aptitude Test Start Test!
Trigonometry - Mock Test Start Test!
Data Interpretation - Mock Test Start Test!
General Awareness - Mock Test Start Test!
Reasoning Ability - Mock Test Start Test!
Englist(Antonyms) Mock Test 1 Start Test!
Quantitative Aptitude (Percentage) Mock Test Start Test!
Economy Mock Test 1 Unlock Test!
Books & Authors - Test 2 Unlock Test!

Chapters

Advertisement