Chapter Questions

DataTypes in java Questions

Explore chapter-wise explanatory questions and quickly move between related subchapters from a cleaner, more advanced layout.

Questions List

Browse all explanatory questions of this chapter.

25 Total Questions
1

Which of the following will compile correctly?

  1. boolean b=-1;
  2. boolean b2=false;
  3. int i=019;
  4. char c=99;
Question ID: 10592 Read Details
2

Which of the following will compile correctly?

  1. short myshort=99S;
  2. String name='Excellent tutorial Mr Green';
  3. char c=17c;
  4. int z=015;
Question ID: 10591 Read Details
3

Which of the following will compile correctly?

  1. float f=10f;
  2. float f=10.1;
  3. float f=10.1f;
  4. byte b=10b;
Question ID: 10590 Read Details
4

Are "true" and true the same? Similarly, are "false" and false the same?

Question ID: 10589 Read Details
5

Is a string of one character the same as a character literal?

Question ID: 10588 Read Details
6

Which values can be assigned to a boolean variable?

Question ID: 10587 Read Details
7

What are Java’s integer types?

Question ID: 10586 Read Details
8

Why does Java use Unicode?

Question ID: 10585 Read Details
9

Why are data types important?

Question ID: 10584 Read Details
10

Can every class be referred to as a user-defined datatype?

Question ID: 8554 Read Details
11

Can you refer to a class as a composite type / user-defined type?

Question ID: 8553 Read Details
12

What is a composite datatype? What is a user-defined datatype?

Question ID: 8552 Read Details
13

What is a datatype?

Question ID: 8551 Read Details
14

What is difference between float and double in Java?

Question ID: 7204 Read Details
15

What is the default value of byte datatype in Java?

Question ID: 324 Read Details
16

What is the numerical range of a char data type in Java?

Question ID: 252 Read Details
17

Can a double value be cast to a byte?

Question ID: 249 Read Details
18

What is Downcasting?

Question ID: 243 Read Details
19

What is the range of the short type?

Question ID: 201 Read Details
20

What is type casting?

Question ID: 197 Read Details
21

Why do we need wrapper classes?

Question ID: 182 Read Details
22

List primitive Java types?

Question ID: 168 Read Details
23

What are Wrapper classes?

Question ID: 139 Read Details
24

Why is String class considered immutable?

Question ID: 80 Read Details
25

When parseInt() method can be used?

Question ID: 79 Read Details