QUIZ 3 - OOP

A colorful and engaging illustration depicting Java programming concepts, focusing on Object-Oriented Programming, including classes, inheritance, and polymorphism in a fun and educational manner.

Mastering Java OOP Concepts

Test your knowledge of Object-Oriented Programming (OOP) concepts in Java with this engaging quiz! Whether you're a beginner looking to solidify your understanding or an experienced programmer wanting to refresh your skills, this quiz will challenge you.

Key Topics Covered:

  • Inheritance Types
  • Polymorphism
  • Exception Handling
  • Thread Management
16 Questions4 MinutesCreated by CodingWizard572
1. Identify inheritance that is not supported in Java programming. (CLO1, C1)
A. Single inheritance
B. Multilevel inheritance
C. Multiple inheritance using classes
D. Multiple inheritance using interfaces
2. If a base class is inherited from another class and then one class derives it, which inheritance is shown?. (CLO1, C2)
A. Multiple
B. Single
C. Hierarchical
D. Multi-level
3. The ability to define more than one function with the same name is called? (CLO2, C2)
A. Inheritance
B. Encapsulation
C. Polymorphism
D. Abstraction
4. Say that there are three classes: Computer, AppleComputer, and IBMComputer. What are the likely relationships between these classes? (CLO2, C2)
A. Computer, AppleComputer and IBMComputer are sibling classes.
B. Computer is the superclass, AppleComputer and IBMComputer are subclasses of Computer.
C. IBMComputer is the superclass, AppleComputer and Computer are subclasses of IBMComputer.
D. Computer is a superclass, AppleComputer is a subclasses of Computer, and IBMComputer is a sublclas of AppleComputer.
5. Which of these is correct way of inheriting class A by class B. (CLO2, C2)
A. class B + class A {}
B. class B inherits class A {}
C. class B extends A {}
D. class B extends class A {}
6. What is the output of this program in Figure 1. (CLO2, C3)
A. 0
B. 1
C. 2
D. Compilation Error
7. If super class and subclass have same variable name, which keyword should be used to use super class? (CLO2, C2)
A. super
B. this
C. upper
D. Class name
8. What is the process of defining a method in a subclass having same name & type signature as a method in its superclass? (CLO2, C2)
A. Method overloading
B. Method overriding
C. Method hiding
D. None of the mentioned
9. Determine the output based on the program code in Figure 2. (CLO2, C3)
A. 21
B. 24
C. 56
D. Compile-time error
10. Identify method that used to initiate the thread. (CLO1, C1)
A. run();
B. construct();
C. start();
D. register();
11. Choose block that gets executed compulsory either exception is caught or not. (CLO2, C2)
A. finally
B. throw
C. throws
D. catch
12. Choose the type of exception that would be thrown based on program code in Figure 3. (CLO2, C2)
A. ArithmeticException
B. NullPointerException
C. NumberFormatException
D. ArrayIndexOutOfBoundsException
13. Complete the program code in Figure 4 that is suitable to start a thread. (CLO1, C2)
A. The program compiles and runs fine and displays test on the console.
B. The program does not compile because this cannot be referenced in a static method.
C. The program compiles fine, but it does not print anything because t does not invoke the run() method
D. None of the above
14. Complete the program code in Figure 5 that is suitable to start a thread. (CLO1, C2)
A. Thread t = new Thread(X);
B. X run = new X(); Thread t = new Thread(run); t.start();
C. Thread t = new Thread(X); t.start();
D. Thread t = new Thread(); x.run();
15. Determine the output of the following program code in Figure 6. (CLO2, C3)
A. CD
B. BCD
C. ACD
D. ABCD
{"name":"QUIZ 3 - OOP", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Test your knowledge of Object-Oriented Programming (OOP) concepts in Java with this engaging quiz! Whether you're a beginner looking to solidify your understanding or an experienced programmer wanting to refresh your skills, this quiz will challenge you.Key Topics Covered:Inheritance TypesPolymorphismException HandlingThread Management","img":"https://cdn.poll-maker.com/104-5107387/img-uvnm6azzwyqa9zdgmccjk25s.jpg"}
Powered by: Quiz Maker