Java Programming - Data Types Questions and Answers - Page 2

(Showing: 11 - 20 out of 20 MCQs) Java Data Types Multiple Choice Questions and Answers for Interviews. Java Data Types Means all variables must first be declared before they can be used.
11. Default value of “double” data type is ?
[A] 0
[B] 0.0
[C] null
[D] 0.0d
Loading...
12. What is the range of data type short in Java ?
[A] -128 to 127
[B] -32768 to 32767
[C] -2147483648 to 2147483647
[D] None of the mentioned
Loading...
13. An expression involving byte, int, and literal numbers is promoted to which of these?
[A] int
[B] long
[C] byte
[D] float
Loading...
14. Which of these literals can be contained in a data type float variable ?
[A] 1.7e-308
[B] 3.4e-038
[C] 1.7e+308
[D] 3.4e-050
Loading...
15. Which data type value is returned by all transcendental math functions?
[A] int
[B] float
[C] double
[D] long
Loading...
16. What is the range of data type int in Java?
[A] -128 to 127
[B] -32768 to 32767
[C] -2147483648 to 2147483647
[D] None of the mentioned
Loading...
17. Default value of Boolean  data type in java.
[A] true
[B] false
[C] 1
[D] 0
Loading...
18. which of the following is the reference data type ?
[A] int
[B] short
[C] double
[D] array
Loading...
19. which notation is used for newline in java ?
[A] \n
[B] \r
[C] \t
[D] \u
Loading...
20. What is the output of following code snippet ?
public class NumberSystem{

public static void main(String[] args){

int val = 0b11010;

System.out.println("Value : " + val);

}

}
[A] 32
[B] 64
[C] 28
[D] 26
Loading...
Are these questions helpful for you?

Comments: (Your feedback is valuable to us)