Data Types and Variables - Multiple Choice Questions with Answers on Core Java

(11) Which one does not have a valueOf(String) method?
[A] Integer
[B] Boolean
[C] Long
[D] Short

Comment

Answer: Option [D]

Java Data Type Short does not have a ValueOf(String) method. The other data types Integer, Boolean, Long, Char, Float, Double have support for the ValueOf(String) method.

(12) Which of the following is NOT an example of a data type?
[A] int
[B] public
[C] boolean
[D] double

Comment

Answer: Option [B]

public is not a data type. It is a Java Access modifier. The other Access modifiers are private and protected.

DOWNLOAD CURRENT AFFAIRS PDF FROM APP

Article and Schedule Quiz Start Test!
(13) Int, long, byte, short are the data types of _____data types?
[A] unsigned
[B] signed
[C] both [A] and [B]
[D] None of these

Comment

Answer: Option [B]
(14) Which of the following is correct?
[A] int a = 16, a>>2 = 4
[B] int b = -8, b>>1 = -4
[C] int a = 16, a>>>2 = 4
[D] All of the above

Comment

Answer: Option [D]
(15) Which of the following is the mutable wrapper class?
[A] Integer
[B] BigInteger
[C] Boolean
[D] Character

Comment

Answer: Option [B]

Java wrapper classes are immutable. BiInteger are mutable.

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