Today my trainer conducted an MCQ test and sent us a question paper. After writing the answers, I scored 15 out of 25.
What is the range of short data type in Java?
a) -128 to 127
b) -32768 to 32767
c) -2147483648 to 2147483647
d) None of the mentionedWhat is the range of byte data type in Java?
a) -128 to 127
b) -32768 to 32767
c) -2147483648 to 2147483647
d) None of the mentionedWhich of the following are legal lines of Java code?
1. int w = (int)888.8;
2. byte x = (byte)100L;
3. long y = (byte)100;
4. byte z = (byte)100L;
a) 1 and 2
b) 2 and 3
c) 3 and 4
d) All statements are correct
Which of the following is not true about Java?
a) Object oriented language
b) High level language
c) 4th generation language
d) Computer languageWhich of these coding types is used for data type characters in Java?
a) ASCII
b) ISO-LATIN-1
c) UNICODE
d) None of the mentionedWhat is the default value of boolean literal?
a) true
b) 1
c) 0
d) falseWhich of these occupy first 0 to 127 in Unicode character set used for characters in Java?
a) ASCII
b) ISO-LATIN-1
c) None of the mentioned
d) ASCII and ISO-LATIN1Which one is a valid declaration of a boolean?
a) boolean b1 = 1;
b) boolean b2 = ‘false’;
c) boolean b3 = false;
d) boolean b4 = ‘true’;Which of these is long data type literal?
a) 9967124623
b) ABCDEFG
c) abcdefg
d) 9967124623LWhich of these can be returned by the operator &&?
a) Integer
b) Boolean
c) Character
d) StringLong literal should be suffixed with ?
a) L or l
b) F or f
c) D or d
d) I or iFloating point literal should be suffixed with?
a) L or l
b) F or f
c) D or d
d) I or iWhich of these cannot be used for a variable name in Java?
a) identifier
b) keyword
c) identifier & keyword
d) none of the mentionedJDK is platform dependent ?
a) true
b) falseJRM is inside JVM ?
a) true
b) falseJava is case in-sensitive language ?
a) true
b) falsePython is derived from java ?
a) true
b) falseJava is 25 times faster than Python in 1995 ?
a) true
b) false
19.Java is derived from C++ ?
a) true
b) false
- What is type conversions in Java ? a) Both type casting and type promotion b) Type casting only c) Type promotion only d) None of the above
- Match the following
- James Gosling - a) Write Once Run Anywhere
- Cup and saucer - b) 23-May-1995
- Java slogan - c) Father of Java
- Java DOB - d) Oracle
- Java current owner - e) Symbol of Java
Answer ****
1)-32768 to 32767
2)-128 to 127
3)All statements are correc
t
4)4th generation language
5)UNICODE
6)false
7)ASCII
8)boolean b3 = false;
9)9967124623L
10)Boolean
11)L or l
12)F or f
13)keyword
14)true (JDK tools are platform dependent, but Java itself is platform independent)
15)false (JRE contains JVM, not inside JVM)
16)false (Java is case sensitive)
17)false
18)true (Java was designed to be much faster than interpreted languages like Python)
19)true (Syntax influenced by C++)
20)Both type casting and type promotion
21)James Gosling → c) Father of Java
22)Cup and saucer → e) Symbol of Java
23)Java slogan → a) Write Once Run Anywhere
24)Java DOB → b) 23-May-1995
25)Java current owner → d) Oracle
Top comments (0)