Which of the following are Java primitive data types?
a. String
b. float
c. Random
d. boolean
e. char
f. int
g. Array
h. math
i. double
j. class
k. none of these correct answers b, d, e, f, i
Which of the following Java literals have the data type int?
a. 123
b. 3f
c. 3.14
d. -3
e. 'a'
f. "3.0"
g. '\n'
h. 3.14f
i. true
j. false
k. "true"
l. 3.0 correct answers a, d
, when the following expression is evaluated, the result will be what Java data type? 3+5.0
a. int
b. float
c. double
d. boolean
e. char
f. String
g. none of the above correct answers c
which of the following would be the best data type for a variable to store a phone number?
a. int
b. float
c. double
d. boolean
e. char
f. String
g. none of these correct answers f
which of the following correctly declares a variable of type int in Java?
a. int a = new int();
b. int a;
c. int a = 0
d. a = int(3);
e. int[] a = 0
f. int [] a = new int [3];
g. none of these correct answers b, c