Courseiva
Knowledge + Practice
CertificationsVendorsCareer RoadmapsLabs & ToolsStudy GuidesGlossaryPractice Questions
C
Courseiva

Free IT certification practice questions with explained answers for CCNA, CompTIA, AWS, Azure, Google Cloud, and more.

Certification Practice Questions

CCNA practice questionsSecurity+ SY0-701 practice questionsAWS SAA-C03 practice questionsAZ-104 practice questionsAZ-900 practice questionsCLF-C02 practice questionsA+ Core 1 practice questionsGoogle Cloud ACE practice questionsCySA+ CS0-003 practice questionsNetwork+ N10-009 practice questions
View all certifications →

Product

CertificationsCertification PathsExam TopicsPractice TestsExam Dumps vs Practice TestsStudy HubComparisons

Company

AboutContactEditorial PolicyQuestion Writing PolicyTrust Center

Legal

Privacy PolicyTerms of Service

Courseiva is a free IT certification practice platform offering original exam-style practice questions, detailed explanations, topic-based practice, mock exams, readiness tracking, and study analytics for Cisco, CompTIA, Microsoft, AWS, and other technology certifications.

© 2026 Courseiva. Courseiva is operated by JTNetSolutions Ltd. All rights reserved.

Courseiva is an independent certification practice platform and is not affiliated with, endorsed by, or sponsored by Cisco, Microsoft, AWS, CompTIA, Google, ISC2, ISACA, or any other certification vendor. Vendor names and certification marks are used only to identify the exams learners are preparing for.

HomeCertifications1Z0-811DomainsObject-Oriented Programming
1Z0-811Free — No Signup

Object-Oriented Programming

Practice 1Z0-811 Object-Oriented Programming questions with full explanations on every answer.

61questions

Start practicing

Object-Oriented Programming — choose a session length

10 questions~10 min20 questions~20 min30 questions~30 min50 questions~50 min

Free · No account required

1Z0-811 Domains

What is JavaJava Basics and SyntaxPrimitives, Strings and OperatorsControl Flow and LoopsArrays and MethodsObject-Oriented ProgrammingException Handling and Development Tools

Practice Object-Oriented Programming questions

10Q20Q30Q50Q

All 1Z0-811 Object-Oriented Programming questions (61)

Start session

Click any question to see the full explanation and answer options, or start a focused practice session above.

1

A developer writes a class 'Vehicle' with a method 'move()' that prints 'Vehicle moves'. A subclass 'Car' overrides 'move()' to print 'Car moves'. Given: Vehicle v = new Car(); v.move(); What is the output?

2

In a banking application, a class 'Account' has a private field 'balance'. Which is the best way to allow subclasses to read but not directly modify 'balance'?

3

A class 'Base' has a method 'public void display() throws IOException'. Subclass 'Derived' overrides display(). Which exception specifications are allowed in the overriding method?

4

Which design principle is violated by making all fields public in a class?

5

Given: abstract class Shape { abstract void draw(); } class Circle extends Shape { void draw() {} } Which is true?

6

Which is the correct way to call a superclass constructor from a subclass constructor?

7

A developer wants to prevent a method from being overridden. Which modifier should be used?

8

Which TWO statements are true about interfaces in Java?

9

Which THREE are benefits of using inheritance?

10

What is the output of: System.out.println(new Manager("Alice", 5).getName());

11

What is the result of: new Document().print();

12

A development team is building a library management system. The system has classes 'LibraryItem', 'Book', and 'DVD'. LibraryItem has a method 'getTitle()' that returns the title. Book and DVD extend LibraryItem. The team wants to ensure that when a LibraryItem is borrowed, a message specific to its type is displayed. They have a 'Borrower' class with a method 'borrow(LibraryItem item)', which currently calls 'item.getTitle()' and prints the title. Now they need to display 'Book borrowed' or 'DVD borrowed' based on the actual item type. They want to avoid using 'instanceof' checks in the 'borrow' method to keep it open for new item types. Which design should they use?

13

Arrange the steps to implement an interface in a Java class in the correct order.

14

Match each Java exception class to its category.

15

A company is developing a configuration manager that must be shared across all components to ensure consistent settings. The manager should prevent direct instantiation and provide a single access point. Which design pattern and implementation should be used?

16

A junior developer writes a method that attempts to modify a String: public void update() { String s = "Hello"; s.concat(" World"); System.out.println(s); } What will be printed when update() is called?

17

A banking application has a base class 'Account' with a method 'withdraw()' marked as final. A subclass 'SavingsAccount' tries to override 'withdraw()'. What is the outcome?

18

A company's HR system uses an Employee class with sensitive salary information. The team wants to allow other classes to read the salary but not modify it. Which approach best preserves encapsulation?

19

A developer creates an interface 'Drawable' with a single abstract method 'draw()'. They then create a class 'Circle' that implements Drawable but forgets to provide the draw() method. Circle is not declared abstract. What will happen when compiling Circle?

20

A security-sensitive class should not be extended by any other class. Which modifier should be applied to the class declaration?

21

A logging utility class keeps track of the number of log entries using a static integer variable. The class is instantiated multiple times in the application. How does the count variable behave?

22

A calculator class has two overloaded methods: add(int a, int b) and add(double a, double b). A call to add(3, 4) will invoke which method?

23

A developer writes a class 'Animal' with a method 'sound()'. The 'Cat' subclass overrides 'sound()'. If an Animal reference points to a Cat object, which method is called when sound() is invoked?

24

Which two of the following are fundamental principles of Object-Oriented Programming? (Choose two.)

25

A developer wants to achieve loose coupling between components. Which two practices support loose coupling? (Choose two.)

26

Which three statements about constructors in Java are true? (Choose three.)

27

Refer to the exhibit. What is the output when the following code is executed? Vehicle v = new Car(); v.accelerate(); System.out.println(v.speed);

28

Refer to the exhibit. Why does the code fail to compile?

29

Refer to the exhibit. What is the potential issue with this singleton implementation in a multithreaded environment?

30

A developer wants to ensure that a class cannot be subclassed. Which keyword should be used?

31

A class has a method that is marked as protected. Which statement is true about its accessibility?

32

Consider the following interface: public interface Drawable { void draw(); } A developer implements Drawable in class Circle. Which statement about the implementation is correct?

33

Which access modifier allows a member to be accessed only within the same class?

34

A developer writes: Object obj = new String("Hello"); System.out.println(obj.length()); What will be the output?

35

Which of the following best demonstrates polymorphism in Java?

36

A class that does not define any constructor has:

37

class Parent { void show() { System.out.print("Parent"); } } class Child extends Parent { void show() { System.out.print("Child"); } } public class Test { public static void main(String[] args) { Parent p = new Child(); p.show(); } } What is the output?

38

Which statement about abstract classes and interfaces is true in Java?

39

Which TWO access modifiers allow access from a subclass in a different package?

40

Which THREE are true about Java constructors?

41

Which TWO statements about interfaces in Java are true?

42

Refer to the exhibit. What is the output?

43

Refer to the exhibit. What is the output?

44

Refer to the exhibit. What is the likely cause?

45

A developer wants to create a class that can be used to represent different types of vehicles (e.g., Car, Truck, Motorcycle) and each vehicle type should be able to start its own engine in a specific way. Which OOP concept should be used to allow the vehicle class to define a common interface while letting subclasses provide specific implementations?

46

A Java class named 'Helper' is defined in package 'utils'. Another class in a different package tries to access a public method of Helper but receives a compilation error. The Helper class is declared as 'class Helper' (without public modifier). What is the likely issue?

47

In a banking application, a class 'Account' has private field 'balance' and public methods 'getBalance()' and 'setBalance(double)'. This is an example of which OOP principle?

48

A team is designing a system where a 'Report' class can be generated in different formats (PDF, Excel, HTML). They want to avoid modifying the Report class when adding new formats. Which OOP principle or pattern should they use?

49

A class 'Animal' has a method 'makeSound()'. Subclasses 'Dog' and 'Cat' override it. When calling makeSound() on an Animal reference that actually holds a Dog object, the Dog's version is executed. This is an example of:

50

A Java application uses an interface 'Drawable' with a default method 'draw()'. A class 'Circle' implements Drawable but does not override draw(). Another class 'Square' implements Drawable and overrides draw(). Which statement is true about calling draw() on instances of Circle and Square?

51

Which TWO of the following are valid benefits of using inheritance in Java? (Choose two.)

52

Which THREE statements are true about interfaces in Java? (Choose three.)

53

Which THREE are fundamental principles of Object-Oriented Programming? (Choose three.)

54

Refer to the exhibit. What is the problem with this class?

55

A team is developing a large-scale e-commerce platform using Java. They have a class hierarchy: Product (abstract), Electronics, Clothing, Food. Each product has a discount method that applies different logic. The team notices that whenever a new product type is added, they must modify the existing discount calculation logic in multiple places, leading to high maintenance costs. They want to refactor to follow the Open/Closed Principle. Which approach should they take?

56

A developer is working on a Java application that processes sensor data. The code uses a class 'SensorDataProcessor' which directly instantiates specific sensor classes like 'TemperatureSensor' and 'PressureSensor' inside its methods. The team wants to make the system extensible to support new sensor types without modifying the processor class. Which design change best achieves this?

57

A junior developer created a class 'BankAccount' with public fields for balance and account number. After deployment, users are able to set negative balances, causing issues. Which OOP principle should have been applied to prevent this?

58

In a Java application, a class 'OrderProcessor' contains a method that processes orders. The method currently handles multiple responsibilities: validating order data, calculating totals, updating inventory, and sending notifications. The team wants to refactor this method to follow the Single Responsibility Principle. Which action should they take?

59

Which TWO statements are true about the 'super' keyword in Java?

60

Refer to the exhibit. What is the output?

61

A company develops a payroll system in Java with a hierarchy: Employee, Manager (extends Employee), and Director (extends Manager). Each class overrides a method getDetails() that returns a string with employee information. Employee's getDetails() returns name and ID. Manager's getDetails() adds department. Director's getDetails() adds division. The system uses a single method printDetails(Employee e) that calls e.getDetails(). After a recent deployment, the system prints only the name and ID for all employees, even for managers and directors. The code review reveals that Employee's getDetails() is declared with default (package-private) access, while the overridden versions in Manager and Director are public. The printDetails method and the Manager/Director classes are in different packages. What is the most likely cause and the correct solution?

Practice all 61 Object-Oriented Programming questions

Other 1Z0-811 exam domains

What is JavaJava Basics and SyntaxPrimitives, Strings and OperatorsControl Flow and LoopsArrays and MethodsException Handling and Development Tools

Frequently asked questions

What does the Object-Oriented Programming domain cover on the 1Z0-811 exam?

The Object-Oriented Programming domain covers the key concepts tested in this area of the 1Z0-811 exam blueprint published by Oracle. Courseiva provides free domain-focused practice, mock exams, missed-question review, and readiness tracking across all 1Z0-811 domains — no account required.

How many Object-Oriented Programming questions are in the 1Z0-811 question bank?

The Courseiva 1Z0-811 question bank contains 61 questions in the Object-Oriented Programming domain. Click any question to see the full explanation and answer breakdown.

What is the best way to practice Object-Oriented Programming for 1Z0-811?

Start with a 10-question focused session to identify your baseline accuracy in this domain. Read every explanation — even for questions you answer correctly — to understand the reasoning. Once you score consistently above 80%, move to a 20–30 question session to confirm depth before moving to the next domain.

Can I practice only Object-Oriented Programming questions for 1Z0-811?

Yes — the session launcher on this page draws questions exclusively from the Object-Oriented Programming domain. Choose 10, 20, 30, or 50 questions for a focused session, or click individual questions to review them one by one.

Free forever · No credit card required

Track your 1Z0-811 domain progress

Save your results, see per-domain analytics, and get readiness scores — free, for every certification.

Sign Up Free

Free forever · Every certification included

Practice Session

10 questions20 questions30 questions50 questions

Study Resources

All DomainsPractice TestMock ExamFlashcardsStudy Guide