ExitPrep

Home / Exit exam / Object Oriented Programming

Object Oriented Programming: exit exam notes

Encapsulation, inheritance, polymorphism, and OOP in Java. Written for the exam in 7 chapters, about 35 minutes of reading in total, plus 227 practice questions to drill. Chapter 1 is below in full and free for everyone. The other chapters open with Premium.

Part of the Computer Science, Computer Science & Engineering, Software Engineering exit exam prep.

Chapters

  1. Introduction to Object-Oriented Programming Free (5 min)
  2. Object and Class (Java) Premium (6 min)
  3. Inheritance Premium (5 min)
  4. Package and Interface Premium (5 min)
  5. Exception Handling Premium (5 min)
  6. File and I/O (Input/Output) Premium (4 min)
  7. Java GUIs using Swing Premium (5 min)

Chapter 1: Introduction to Object-Oriented Programming

1.1 Computer Systems and Programs

A Computer System consists of two essential components:

Computer Programs and Languages:

1.2 Classifications and Paradigms of Programming Languages

Programming languages can be classified into three main categories:

  1. Generation: Based on the level of abstraction from machine code (e.g., Machine code, assembly, high-level languages).
  2. Purpose: Based on the task the language is designed for (e.g., General-purpose, special-purpose).
  3. Paradigm: Based on the style of programming.

1.2.1 Major Programming Paradigms

A Programming Paradigm defines how code is written and structured. The most common paradigms include:

  1. Procedural Programming: The oldest and most basic paradigm. It uses a top-down approach where code is written as a series of procedures/functions that perform specific tasks (e.g., C, Pascal, Fortran).
  2. Object-Oriented Programming (OOP): Uses classes (blueprints) and objects (instances containing data and code) to structure a program. It promotes reusable and modular code (e.g., Java, Smalltalk, Ruby).
  3. Functional Programming: Based on self-contained functions that take inputs and produce outputs without side effects (the output does not depend on the program's state outside the function) (e.g., Haskell, Lisp, Scala).
  4. Logic Programming: Based on principles of logic using a declarative style. The programmer specifies the desired output rather than the step-by-step process (e.g., Prolog).

1.3 Principles of Object-Oriented Programming (OOP)

There are four fundamental pillars of OOP:

  1. Encapsulation: The bundling of data (variables) and methods into a single unit called an object. This hides data from the outside world and only allows access through well-defined interfaces.
  2. Abstraction: The process of hiding complex implementation details from the user. It allows users to focus purely on the functionality of the class without needing to understand how it works internally.
  3. Inheritance: The ability of a class to inherit properties and methods from another class. This allows for code reuse and the creation of complex classes from simpler ones (e.g., a "Dog" class inheriting from an "Animal" class).
  4. Polymorphism: The ability of a single method to behave differently depending on the specific type of object it is called upon.

1.4 Introduction to Java

1.4.1 Key Features of Java

1.5 Java Architecture and Execution

1.5.1 The Compilation Process

Standard high-level languages use either a Compiler (translates the whole program to machine code at once) or an Interpreter (translates line-by-line). Java uses a hybrid strategy:

  1. Java source code (.java) is compiled into intermediate Java bytecodes (.class).
  2. This bytecode acts as machine language for a theoretical computer called the JVM.
  3. The JVM then interprets this bytecode to run on the specific host OS (Windows, Linux, macOS).

1.5.2 JVM and JIT

1.5.3 Java Development Kit (JDK) Hierarchy

1.6 Java Editions

Java is divided into four main editions based on the target audience and application type:

  1. Java SE (Standard Edition): The foundation. Contains the core language and APIs for graphics, networking, and databases. Target: General Developers.
  2. Java EE (Enterprise Edition): APIs for building large, enterprise-scale applications (web dev, messaging, security). Target: Enterprise Developers.
  3. Java ME (Micro Edition): APIs for building lightweight applications for mobile devices and embedded systems. Target: Mobile/Embedded Developers.
  4. JavaFX: Newer APIs for building rich, interactive user interfaces for desktop, mobile, and web.
6 more chapters in this course: Object and Class (Java); Inheritance; Package and Interface; Exception Handling; File and I/O (Input/Output); Java GUIs using Swing. They are part of Premium, from 200 ETB for 3 months, together with every past paper and unlimited practice.

Study Object Oriented Programming in the app

Read on your phone or laptop, drill the practice questions for this course and track what you got wrong. Free to start.

Start studying free Log in

All Computer Science courses, papers and practice