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%

Continue answering

Q1 · Java Basics

What will be the output of the following java code: class Example { public static void main(String[] args) { int g=3; System.out.println(++g*8); } }

Not answered

Q2 · JDBC

Which of the following JDBC components is used to handle communication with the database server?

Not answered

Q3 · Java Basics

Which of the following is not a feature of Java?

Not answered

Q4 · Event Handling

Which of the following is not an adapter class used in event handling?

Not answered

Q5 · JDBC

Which of the following methods is used to execute a SELECT query in JDBC API?

Not answered

Q6 · Exception Handling

Which of these keywords is not a part of exception handling?

Not answered

Q7 · Java Basics

In which of the following packages does the Integer class exist?

Not answered

Q8 · Java Basics

Which of the following is a Java compiler?

Not answered

Q9 · Exception Handling

Which of the following keywords is used to throw an exception manually?

Not answered

Q10 · Streams

Which of the following is not a byte stream input class?

Not answered

Q11 · Operators

Which one of the following is a ternary operator?

Not answered

Q12 · Java Basics

Which keyword is used to make a variable constant in Java?

Not answered

Q13 · GUI

The method that returns a string associated with a GUI Button is:

Not answered

Q14 · OOP

Which of the following is a type of polymorphism in Java Programming?

Not answered

Q15 · OOP

Which of the following is a superclass of every class in Java?

Not answered

Q16 · Applet

Which method is automatically called after the browser calls the init method?

Not answered

Q17 · Java Basics

Which of the following packages is imported by default in Java?

Not answered

Q18 · Event Handling

Which of the following is not a mouse event in Java?

Not answered

Q19 · Java Basics

What is the first step in running the java program?

Not answered

Q20 · Operators

What is the value of x after int x = 5; x += x++ + ++x; ?

Not answered

Q21 · Java Basics

Which of the following is not a keyword in Java?

Not answered

Q22 · Operators

Which of these operators can skip evaluating the right-hand operand?

Not answered

Q23 · OOP

Which is a correct method for method overloading?

Not answered

Q24 · OOP

What does the super keyword do?

Not answered

Q25 · Exception Handling

What happens when no exception occurs in try block?

Not answered

Q26 · Operators

Which one of the following is not a valid Java bitwise operator?

Not answered

Q27 · Java Basics

Which of the following package stores all the standard java classes?

Not answered

Q28 · Exception Handling

Which of these operator is used to generate an instance of an exception that can be thrown using throw?

Not answered

Q29 · Strings

Which of these method of class StringBuffer is used to concatenate the string representation to the end of invoking string?

Not answered

Q30 · Exception Handling

Which one of the following keywords is used to declare an exception?

Not answered

Q31 · Arrays

Which of these is an incorrect array declaration?

Not answered

Q32 · OOP

Which one of the following access specifiers is appropriate for members of a superclass to access only from subclass?

Not answered

Q33 · Collections

Which one of the following is not a collection class defined in Java?

Not answered

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?

Not answered

Q35 · Java Basics

What is the size of char type in Java?

Not answered

Q36 · Java Basics

Which of the following is not a keyword in Java?

Not answered

Q37 · Java Basics

Which of the following methods is directly accessed without creating an object?

Not answered

Q38 · Java Basics

Which of the following is not a valid declaration of a for loop?

Not answered

Q39 · OOP

What is the process by which one object acquires all the properties and behaviors of another object?

Not answered

Q40 · Exception Handling

Which of the following is an unchecked exception in Java?

Not answered

Q41 · GUI

Which of the following class is defined in the javax.swing package?

Not answered

Q42 · OOP

Which one of the following types of inheritance is implemented using interfaces in Java?

Not answered

Q43 · Applet

Which one of the following methods is called only once during the runtime of your applet?

Not answered

Q44 · OOP

What is the process by which we control which parts of a program can access members of a class?

Not answered

Q45 · Java Basics

What is the return type of a constructor in Java?

Not answered

Q46 · OOP

Which keyword is used to refer to the base class constructor from a subclass constructor in Java?

Not answered

Q47 · Streams

Which of these class contains the methods used to write in a file?

Not answered

Q48 · GUI

Which of the following function is used to generate the application's top-level window?

Not answered

Q49 · Java Basics

Which of the following is not a primitive data type defined in Java?

Not answered

Q50 · Input

Which function is used to get a single character from the Scanner?

Not answered

Q51 · Java Basics

Which of the following is not a jumping statement in Java?

Not answered

Q52 · Exception Handling

Which of the following is not a keyword used in exception handling?

Not answered

Q53 · Java Basics

Which of the following is not a method of the Wrapper class?

Not answered

Q54 · Strings

Which of these methods of class String is used to compare two string objects for their equality?

Not answered

Q55 · Threads

What is the default value of the priority variables MIN_PRIORITY and MAX_PRIORITY?

Not answered

Q56 · GUI

Which one of the following is not a Java Swing container?

Not answered

Q57 · Threads

Which of these statements is incorrect about Thread?

Not answered

Q58 · Serialization

Which of these is an interface in Java for control over serialization and deserialization?

Not answered

Q59 · Strings

Which class is used for immutable strings?

Not answered

Q60 · Threads

Which method is used to pause a thread for a while?

Not answered

Q61 · Serialization

What is deserialization?

Not answered

Q62 · Operators

If a = 10 and b = 6, then what will be the value of a ^ b in Java?

Not answered

Q63 · OOP

Which of the following inheritance is not directly available in Java?

Not answered

Q64 · OOP

Which of the following keywords is used to derive a child interface from a parent interface?

Not answered

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?

Not answered

Q66 · Streams

Which of the following classes is used to read data from a file in a character stream?

Not answered

Q67 · Collections

Which of the following is not a method of Iterator?

Not answered

Q68 · GUI

What is the name of the Swing control that normally displays one entry and acts as a dropdown list?

Not answered

Q69 · Java Basics

Which method is used to convert a String to an Integer?

Not answered

Q70 · GUI

Which layout manager arranges components in a single row?

Not answered