Q1 · Java Basics
OOP in Java MCQs
OOP in Java Full Question Bank
Tap an option, see immediate feedback, retry the wrong ones, and review the final correct answers at the end.
Questions
70
Answered
0
Score
0%
Q2 · JDBC
Which of the following JDBC components is used to handle communication with the database server?
Q3 · Java Basics
Which of the following is not a feature of Java?
Q4 · Event Handling
Which of the following is not an adapter class used in event handling?
Q5 · JDBC
Which of the following methods is used to execute a SELECT query in JDBC API?
Q6 · Exception Handling
Which of these keywords is not a part of exception handling?
Q7 · Java Basics
In which of the following packages does the Integer class exist?
Q8 · Java Basics
Which of the following is a Java compiler?
Q9 · Exception Handling
Which of the following keywords is used to throw an exception manually?
Q10 · Streams
Which of the following is not a byte stream input class?
Q11 · Operators
Which one of the following is a ternary operator?
Q12 · Java Basics
Which keyword is used to make a variable constant in Java?
Q13 · GUI
The method that returns a string associated with a GUI Button is:
Q14 · OOP
Which of the following is a type of polymorphism in Java Programming?
Q15 · OOP
Which of the following is a superclass of every class in Java?
Q16 · Applet
Which method is automatically called after the browser calls the init method?
Q17 · Java Basics
Which of the following packages is imported by default in Java?
Q18 · Event Handling
Which of the following is not a mouse event in Java?
Q19 · Java Basics
What is the first step in running the java program?
Q20 · Operators
What is the value of x after int x = 5; x += x++ + ++x; ?
Q21 · Java Basics
Which of the following is not a keyword in Java?
Q22 · Operators
Which of these operators can skip evaluating the right-hand operand?
Q23 · OOP
Which is a correct method for method overloading?
Q24 · OOP
What does the super keyword do?
Q25 · Exception Handling
What happens when no exception occurs in try block?
Q26 · Operators
Which one of the following is not a valid Java bitwise operator?
Q27 · Java Basics
Which of the following package stores all the standard java classes?
Q28 · Exception Handling
Which of these operator is used to generate an instance of an exception that can be thrown using throw?
Q29 · Strings
Which of these method of class StringBuffer is used to concatenate the string representation to the end of invoking string?
Q30 · Exception Handling
Which one of the following keywords is used to declare an exception?
Q31 · Arrays
Which of these is an incorrect array declaration?
Q32 · OOP
Which one of the following access specifiers is appropriate for members of a superclass to access only from subclass?
Q33 · Collections
Which one of the following is not a collection class defined in Java?
Q34 · GUI
Which one of the following is the container that doesn't contain a title bar and menu bar but can have other GUI components such as buttons and text fields?
Q35 · Java Basics
What is the size of char type in Java?
Q36 · Java Basics
Which of the following is not a keyword in Java?
Q37 · Java Basics
Which of the following methods is directly accessed without creating an object?
Q38 · Java Basics
Which of the following is not a valid declaration of a for loop?
Q39 · OOP
What is the process by which one object acquires all the properties and behaviors of another object?
Q40 · Exception Handling
Which of the following is an unchecked exception in Java?
Q41 · GUI
Which of the following class is defined in the javax.swing package?
Q42 · OOP
Which one of the following types of inheritance is implemented using interfaces in Java?
Q43 · Applet
Which one of the following methods is called only once during the runtime of your applet?
Q44 · OOP
What is the process by which we control which parts of a program can access members of a class?
Q45 · Java Basics
What is the return type of a constructor in Java?
Q46 · OOP
Which keyword is used to refer to the base class constructor from a subclass constructor in Java?
Q47 · Streams
Which of these class contains the methods used to write in a file?
Q48 · GUI
Which of the following function is used to generate the application's top-level window?
Q49 · Java Basics
Which of the following is not a primitive data type defined in Java?
Q50 · Input
Which function is used to get a single character from the Scanner?
Q51 · Java Basics
Which of the following is not a jumping statement in Java?
Q52 · Exception Handling
Which of the following is not a keyword used in exception handling?
Q53 · Java Basics
Which of the following is not a method of the Wrapper class?
Q54 · Strings
Which of these methods of class String is used to compare two string objects for their equality?
Q55 · Threads
What is the default value of the priority variables MIN_PRIORITY and MAX_PRIORITY?
Q56 · GUI
Which one of the following is not a Java Swing container?
Q57 · Threads
Which of these statements is incorrect about Thread?
Q58 · Serialization
Which of these is an interface in Java for control over serialization and deserialization?
Q59 · Strings
Which class is used for immutable strings?
Q60 · Threads
Which method is used to pause a thread for a while?
Q61 · Serialization
What is deserialization?
Q62 · Operators
If a = 10 and b = 6, then what will be the value of a ^ b in Java?
Q63 · OOP
Which of the following inheritance is not directly available in Java?
Q64 · OOP
Which of the following keywords is used to derive a child interface from a parent interface?
Q65 · Threads
What is the process when two or more threads need to access a shared resource, and they need a way to ensure that the resource is used by only one thread at a time?
Q66 · Streams
Which of the following classes is used to read data from a file in a character stream?
Q67 · Collections
Which of the following is not a method of Iterator?
Q68 · GUI
What is the name of the Swing control that normally displays one entry and acts as a dropdown list?
Q69 · Java Basics
Which method is used to convert a String to an Integer?
Q70 · GUI