Object Oriented Programming in Java MCQ with Answers

Object Oriented Programming in Java MCQ with Answers for the preparation of IT academic and competitive exams of various Institutes.

Are you a Java programmer looking to enhance your understanding of Object Oriented Programming (OOP) concepts? As the world of software development continues to evolve, it becomes increasingly important for developers to possess a strong foundation in OOP principles. One effective way to solidify your knowledge is by practicing with Multiple Choice Questions (MCQs).

In this article, we will provide you with a comprehensive collection of Object Oriented Programming in Java MCQs along with their answers, specifically designed for the year 2024.

Whether you are preparing for an interview or certification exam, or simply seeking self-improvement, these MCQs will serve as a valuable resource to test your comprehension and reinforce key OOP concepts in Java.

Object Oriented Programming in Java MCQ with Answers

1. Which of the following is an object encapsulated inside the System class?
A) out
B) println
C) Both A and B
D) None of the above

2. Employee emp = ___ Employee (); Pick a suitable word from the list so that an object of the class Employee is created.
A) object
B) class
C) run
D) new

3. What is the output for the following code: System.out.println (“Hello World”);
A) Shows error
B) Hello World
C) “Hello World”
D) None of the above

4. ___ provides a standard interface to common system resources.
A) new
C) System
D) None of the above

5. Which of the following is also known as SDK:
A) devkit
D) None of the above

6. Which feature of Java is used to dynamically link code in a safe and expedient manner:
A) Secure
B) Distributed
C) Dynamic
D) Robust

7. Which of the following additional package is included by JDK:
A) java.awt
B) sun.addtools.debug
C) java.util
D) sun.tools.debug

8. Which among the following is not a feature of Java:
A) Portable
B) Structured
C) Distributed
D) High Performance

9. ___ is a Java run-time system that chooses to execute the JAVA Bytecode:
D) None of the above

10. Which of the following operators are used to compare two values and give the results:
A) Increment and Decrement
B) Logical
C) Comparison
D) Arithmetic

11. What is the result of the expression: 10+5*8-15/5
A) 3
B) 47
C) 7
D) 21

12. ___ is a common programming construct that is based upon a sequence of nested if:
A) switch
B) nested if
C) if-else-if ladder
D) None of the above

13. ___ statement is Java’s multi-way branch statement.
A) switch
B) nested if
C) break
D) if-else-if ladder

14. Which loop always executes its body at least once, even though the condition is not true:
A) for
B) do-while
C) while
D) continue

15. ___ is used to exit from a loop:
A) continue
B) quit
C) break
D) None of the above

16. Which of the following method can be used to set the size of the buffer:
A) ensureCapacity( )
B) length( )
C) capacity( )
D) setLength( )

17. Which of the following method returns the reversed object on which it is called:
A) insert( )
B) replace( )
C) delete( )
D) reverse( )

18. String indexes begin at:
A) 1
B) 3
C) 0
D) 2

19. Which of the following is a special operator to allocate memory:
A) New
B) Old
C) ++
D) –

20. Both the String and StringBuffer classes are defined in ____ package:
A) java.awt
B) java.io
C) java.lang
D) java.util

21. Method used to extract a single character from a String:
A) toCharArray( )
B) getChars( )
C) getBytes( )
D) charAt( )

22. Human Being and Elephant fall under which of the following relationship:
A) Kind-Of
B) Is-A
C) Part-Of
D) Has-A

23. Which of the following allows the creation of hierarchical classifications?
A) Interface
B) Inheritance
C) Package
D) Polymorphism

24. A class member that has been declared as private will be ___ to its class.
A) Friendly
B) Public
C) Protected
D) Private

25. Which of the following keywords is used to prevent inheritance:
A) final
B) catch
C) extends
D) super

Share on Social Media

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *