Java MCQS
Java MCQS
4. A class has always a constructor (possibly automatically supplied by the java compiler).
2. A constructor
4. A, B and C
1. instance variables
2. instance methods
3. constructors
4. A, B, and C
1. The operating system periodically deletes all of the java files available on the system
3. When all references to an object are gone, the memory used by the object is automatically
reclaimed
4. The JVM checks the output of any Java program and deletes anything that doesnt make
sense
8. JVM is a
1. Debugger
2. Assembler
3. Interpreter
4. Compiler
1. JRE
2. linker
3. JVM
4. Assembler
2. Executable code
1. true
2. false
12. Bytecode is a set of highly optimizable code. True or false
1. true
2. false
1. true
2. false
14. JVM will differ from platform to platform but still all understand the Same Java Bytecode
1. true
2. false
15. The compiler and other java development tools reside in _________ sub-folder.
1. jre
2. bin
3. docs
4. demo
16. The library containing the files needed to integrate Java with programs written in other languages
resides inside following sub folder.
1. jre
2. bin
3. include
4. lib
1. javapath
2. class
3. path
4. java
1. Environment Variable
2. Local Variable
3. Instance Variable
4. Global Variable
19. Environment Variable can be set by right clicking __________ icon and then clicking on
Properties menu in Windows OS.
1. Internet Explorer
2. Recycle Bin
3. Control Panel
4. My Computer
20. Arrange the following statements in correct order. 1. Running the java command Statement. 2.
Main method of that class is executed Statement. 3. JRE is loaded along with the class you specify.
1. Statement: 2 1 3
2. Statement: 1 3 2
3. Statement: 1 2 3
4. Statement: 3 2 1
1. java-version
2. javac
3. jre
4. java
1. .sample.class
2. .class
3. .cls
4. .java
23. The name of the class file is created automatically when you compile the program with the javac
command.
1. true
2. false
24. _______ is a compiled Java program that can be executed by the _______ command.
1. Bytecode
2. .exe
3. Source code
4. .obj
1. javac
2. jar
3. java
4. javadoc
27. Which of the following tool used to execute java code.
1. javadoc
2. java
3. rmic
4. javac
28. Which of the following is used to interpret and execute Java Applet Classes hosted by HTML.
1. appletshow
2. appletscreen
3. appletviewer
4. appletwatcher
1. none of these
2. javadoc
3. javahelp
4. javamanual
1. none of these
2. Java Archive
3. Java Application Runner
31. Which of the following is used to see the details of the compilation
3. None of these
1. boolean
2. assert
3. finalize
4. abstract
1. strictfp
2. instanceof
3. emun
4. transient
34. We can write comment like this jn Java Programming: /* /* comment 1 */ comment 2 */
1. true
2. false
4. none of these
1. False statement
2. True statement
37. boolean result = true; Which type of literal is assigned to the variable result?
1. boolean
2. char
3. string
4. bool
1. float
2. boolean
3. integer
4. character
39. An integer literal is of type long if and only if it has suffix - ______ in Java programming.
1. L
2. D
3. O
4. F
40. ____ literal is used to create values of the integral types byte, short, int and long.
1. Double
2. Integer
3. Byte
4. Long
41. Number system whose digits consists of the numbers 0 through 9 is called as ____________.
42. Question 244 Hexa Decimal Numbers are having base _________.
1. 10
2. 8
3. 2
4. 16
44. Integer literal containing value "F" comes under _______ system.
1. Octal number
2. Binary number
3. None of these
45. Following example of Nested Comments is allowed in Java Programming Language. // /*Nesting
of Comment */
1. true
2. false
1. //
2. /* *
3. /*
4. none of these
1. .class
2. .obj
3. .jar
4. .java
48. Which of the following converts human readable file into platform independent code file in Java?
1. JRE
2. Compiler
3. JVM
4. appletwatcher
49. Platform independent code file created from source file ins understandable by ________.
1. JRE
2. Applet
3. JVM
4. Compiler
1. Source Code
2. Compiled code
53. Java is called as platform independent language. Do you agree with this statement?
1. Yes
2. No
54. We can run same java program on different environment with same JDK version.
1. true
2. false
1. 9
2. 8
3. 6
4. 7
1. Bytecode
2. int
3. short
4. long
2. enum
3. short
4. byte
58. Integer Data type does not include following primitive data type.
1. long
2. double
3. short
4. byte
59. Which of the following data types comes under floating data types: 1.Float 2.Int 3.Double 4.Byte
5.Long
1. 1 and 2
2. 1 and 3
3. 2 and 3
4. 4 and 5
2. string
3. letter
4. digit
61. Byte variables are declared by use of the _______ keyword (Using primitive data type)
1. Bytes
2. Byte
3. byte
4. bytes
1. -127 to 128
2. -128 to 256
3. -128 to 255
4. -128 to 127
63. In order to fetch stream of data from network of file, following data type is used _______.
1. int
2. byte
3. char
4. double
1. 2 Bytes
2. 8 Bytes
3. 3 Bytes
4. 4 Bytes
1. Oracle
2. Sun
3. Microsoft
4. Apple
4. none of these
3. Command prompt
4. none of these
2. ntelliJ IDEA
3. Eclipse
69. Front end applications which includes GUI are created using
1. IDE
2. Dos
3. Compiler
4. JVM
70. We can also use command line tool to run java application.
1. true
2. false
71. Which of the following is not a Java Code Editor?
1. Ms-Word
2. Netbeans
3. Notepad ++
4. Edit +
1. true
2. false
73. We can run java program directly from the IDE using shortcut.
1. true
2. false
1. true
2. false