Java MCQ
Java MCQ
Answer: b
Solution: The Java program was developed by James Gosling at Sun Microsystems in 1995.
James Gosling is known as the father of Java.
a) JRE
b) JIT
c) JDK
d) JVM
Answer: c
Solution: JDK is an integral part of the Java Area and provides all the tools, binary needed to
integrate, debug and launch the Java Program.
a) MemoryError
b) OutOfMemoryError
c) MemoryOutOfBoundsException
d) MemoryFullException
Answer: b
Solution: The Xms flag has no default value, and Xmx typically has a default value of
256MB. A common use of these flags is when you encounter java.lang.OutOfMemoryError.
a) a break
b) continue
c) for ()
d) if ()
Answer: d
Solution: Continue and break comes under the jump statements, and for falls under the
looping statement.
5. Which of these keywords is used to define interfaces in Java?
a) intf
b) Intf
c) interface
d) Interface
Answer: c
a) Array List
b) Abstract Class
c) Object class
d) String
Answer: c
a) JProfiler
b) Eclipse Profile
c) JVM
d) JConsole
Answer: c
Solution: A leak in memory is like holding a solid reference in an object though it will no
longer be needed. Accessible but inanimate objects are considered memory leaks. Various
tools help us to detect memory loss.
a) java.io
b) java.system
c) java.lang
d) java.util
Answer: c
Answer: b
Solution: The run () method used to define a code that forms a new string, contains the code
to be used. start () method is used to start the release of the running series (). run () itself has
never been used for series implementation.
a) check
b) throw
c) catch
d) try
Answer: d
a) Protected
b) Void
c) Public
d) Confidential
Answer: b
12. What is the range for the type of char data in Java?
a) 0 to 256
b) -128 to 127
c) 0 to 65535
d) 0 to 32767
Answer: c
Solution: Char takes 16-bit memory, so it supports 216, that is from 0 to 65535.
13. Which section provides for the implementation of the private server side of the
system?
a) Server
b) ServerReader
c) Socket
d) ServerSocket
Answer: d
Answer: b
Solution: Applications run within the web server address area. As it is written in java
independent. Full functionality is available through libraries.
a) .txt
b) .js
c) .class
d) .java
Answer: c
a. Object References
b. Objects
c. Primitive Data type
d. None
Answer: b. Objects
Solution: Arrays are objects in java. It is a container that holds a fixed number of items
of a single type.
a. 3
b. 7
c. 13
d. 20
Answer: 13
a. Heap
b. Stack
c. Array
d. Tree
Answer: b. Stack
a. Abstract class
b. Interface
c. Class
d. Method
Answer: b. Interface