Multiple Choice Question
(1) How many basic (primitive) data types are supported in Java ?
(a) 2
(b) 4
(c) 8
(d) 16
(2) What is the default data type of floating point literal ?
(a) int
(b) long
(c) float
(d) double
(3) Which character set is used for char data type in Java?
(a) Unicode
(b) ASCII
(c) EBCIDIC
(d) All of these
(4) Which of the following is compiled error free?
(a) for(;;) {int i=7};
(b) while (1){int i=7};
(c) while (True){int i=7};
(d) All of these
(5) Which of the following is not allowed as first character in valid variable name?
(a) Underscore
(b) Digit
(c) Letter
(d) Dollar ($)
(6) Which of the following is not a basic data type in Java ?
(a) char
(b) long
(c) byte
(d) String
(7) What is the default value of boolean type data ?
(a) null
(b) true
(c) false
(d) 0
(8) What will be the result of arithmetic expression 7/2 ?
(a) 3
(b) 3.5
(c) 1
(d) 0
(9) What will be the result of arithmetic expression -7%2?
(a) -3
(b) -1
(c) 1
(d)-3.5
(10) What will be the result of arithmetic expression -7.5%2 ?
(a) -3
(b) -1.5
(c) 1.5
(d) Error