Programming - Programming in Java MCQS

A. A scripting language
B. A markup language
C. A programming language
D. A database language
A. constant
B. const
C. final
D. static
A. main() method
B. start() method
C. execute() method
D. run() method
A. int
B. float
C. double
D. class
A. Refer to the current object
B. Refer to the parent class
C. Refer to the child class
D. Refer to the global scope
A. new
B. malloc
C. instantiate
D. create
A. true
B. false
C. 0
D. 1
A. Using interfaces
B. Using abstract classes
C. Using multiple extends keyword
D. Java doesn't support multiple inheritance
A. Invoke superclass constructor
B. Refer to the subclass object
C. Invoke a static method
D. Create a superclass instance
A. ArrayList
B. HashSet
C. HashMap
D. Vector
A. Define exceptions
B. Throw exceptions
C. Catch exceptions
D. Propagate exceptions
A. finalize()
B. dispose()
C. clean()
D. destroy()
A. Hello3
B. Hello12
C. Hello21
D. Compile error
A. final
B. static
C. private
D. protected
A. Check if an object is an instance of a class
B. Compare two objects
C. Check if a class is an instance of an object
D. Check if an object is null
A. Abstract class can have constructors
B. Interface can have constructors
C. Abstract class can have abstract methods
D. Interface can have non-abstract methods
A. Skip to the next iteration
B. Exit the loop
C. Restart the loop
D. Skip to the next loop
A. int[] arr;
B. int arr();
C. array arr;
D. array[] arr;
A. using
B. extends
C. implements
D. inheritance
A. 7
B. 8
C. 7.8
D. 8.0
A. Define exceptions
B. Throw exceptions
C. Catch and handle exceptions
D. Propagate exceptions
A. Runnable
B. Serializable
C. Comparable
D. Cloneable
A. Using the run() method
B. Extending the Thread class
C. Implementing the Runnable interface
D. Both B and C
A. Define exceptions
B. Throw exceptions
C. Catch exceptions
D. Cleanup code
A. Create a static method
B. Create a static variable
C. Define a constant
D. Create a static class
A. compare()
B. equals()
C. compareTo()
D. equality()
A. 3.33
B. 3.0
C. 3
D. 3.333333
A. Object obj = new Object();
B. class obj = new class();
C. Object obj = createObject();
D. obj = createObject();
A. Execute the default case
B. Define a default value
C. Provide a default constructor
D. Specify default permissions
A. true
B. false
C. Compile error
D. Runtime error
A. read()
B. input()
C. System.in.read()
D. Scanner.next()
A. Garbage collection
B. Exception handling
C. Object cloning
D. Method overloading
A. const int CONSTANT = 5;
B. final int CONSTANT = 5;
C. static final int CONSTANT = 5;
D. public final int CONSTANT = 5;
A. ArrayList arr = new ArrayList();
B. List arr = new List();
C. List arr = new ArrayList();
D. ArrayList arr = new List();
A. Invoke the superclass constructor
B. Refer to the parent class
C. Invoke the subclass constructor
D. Create a superclass instance