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
Article and Schedule Quiz 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 FULL LENGTH MOCK TEST

Take Mock Tests

Missiles Mock Test Start Test!
SSC MTS Mock Test Start Test
IBPS CLERK MOCK TEST Start Test
SSC MTS 2022 JULY 26 Shift 1 (ENGLISH) Start Test!
SSC GD Previous Year Paper 2021 Nov 17 Shift - I (Hindi) Start Test!
SSC CGL Tier - 1 PYP 2022 April 21 Shift- 1 (ENGLISH) Start Test!
MPSC PAPER I MOCK TEST 1 (ENGLISH) Start Test!
IB Security Assistant Mock test 1 (english) Start Test!
UP POLICE CONSTABLE MOCK TEST 1 Start Test!
DELHI POLICE CONSTABLE MOCK TEST 1 (HINDI) Start Test!

Chapters

Advertisement