Object-oriented Programming

Object-oriented programming (OOP) is a programming paradigm that organizes data and behavior into reusable structures called objects. Each object contains data (often attributes or properties) and methods (functions that operate on the object’s data).

 

Object-oriented programming has four major principles which are, Encapsulation, Inheritance, Abstraction and Polymorphism. 

 

Encapsulation

 

Encapsulation refers to combining data (attributes) and methods (functions) that operate on the data into a single unit called a class. This mechanism helps conceal the object's internal state from the outside world and enables access to data through public methods, such as getters and setters. In other words, encapsulation provides a way to keep data and methods safe and secure within the class and only allows controlled access.

 

Features

 

Data Hiding: The data within an object is hidden and can only be accessed and modified through its public methods, ensuring data security and integrity.

 

Access Modifiers: determine the visibility of class members. Public members can be accessed from any part of the program, private members can only be accessed within the class, and protected members can be accessed within the class and its subclasses.

 

Information Hiding: Object implementation details are hidden behind a straightforward interface, promoting modularity, and simplifying complex systems.

 

Inheritance

Inheritance enables a subclass to inherit properties and methods from a superclass, promoting code reuse and establishing hierarchy.

Features

Code Reusability: Subclasses inherit attributes and methods from the superclass, reducing redundancy and promoting efficient code use.

Method Overriding: Subclasses can customize behavior by implementing methods already defined in its superclass.

Single, Multiple, and Multilevel Inheritance: Single inheritance involves a class inheriting from one superclass; multiple inheritance allows a class to inherit from more than one superclass. Multilevel inheritance is a chain where one class extends another, creating a hierarchy.

 

Polymorphism

 

Polymorphism enables a single interface to represent different underlying forms, providing flexibility and abstraction in programming. Objects of different classes can be treated as objects of a common superclass.

 

Features

 

Method Overloading: Within a class, methods can have the same name but different parameters. The appropriate method is determined based on the number and types of parameters during compile-time, known as compile-time polymorphism.

 

Method Overriding: During runtime, the appropriate method is called based on the object's actual type, allowing subclasses to provide a specific implementation of a method already defined in the superclass (runtime polymorphism).

 

Interfaces and Abstract Classes: Concrete classes must implement methods defined in interfaces. Abstract classes can have both abstract and concrete methods, serving as a blueprint for derived classes.

 

Abstraction

 

Abstraction simplifies complex systems by modeling appropriate classes and working at relevant inheritance levels.

 

Features

 

Abstract Classes: Abstract classes are templates for derived classes and cannot be instantiated. They may contain abstract methods that derived classes must implement.

 

Interfaces: Interfaces define a contract for implementing classes, specifying a set of methods that must be provided. They allow multiple inheritance of method signatures, enabling objects to be treated uniformly.

 

Object-oriented programming principles allow developers to create efficient, modular, and extensible software systems, promoting better code organization, reusability, and maintainability.

 

 

JAVA Installation and Hello World App

 

These are some of the resources I found helpful when installing Java, the IDE environment and creating the Hello World App.

 

https://youtu.be/fP0Oz4Qk8js?si=5l2KyqfzoMUfrAg4

 

https://youtu.be/wXotUgqOdh8?si=tGUCDdKWw5UMymrw

 

https://www.oracle.com/java/technologies/downloads/


https://netbeans.apache.org/download/index.html

 

https://docs.oracle.com/javase/tutorial/getStarted/cupojava/netbeans.html

 

 

 

Comments