Basics of OOP & Java Help
Object-Oriented Programming
In other words, OOP is centered on the concepts of objects where data structures are characterized by their own properties or attributes. Each object containing its own approach/method - object-oriented programming is a paradigm that provides various concepts like inheritance, abstraction, and encapsulation.
These concepts will be imperative for any individual starting out in the world of coding. The introduction of these concepts not only relate to the physical world but to the syntax of Java programming
The Principles of Object-Oriented Programming
Inheritance - child classes inherit data and behaviors from the parent class
Encapsulation - containing information in an object, exposing only selected information
Abstraction - only exposing high-level public methods for accessing an object
Polymorphism - many methods can do the same task
- Object: What is an object? Entities that have states and behavior are known as an object. It can be tangible or intangible - in the context of the physical an object can be a pen, chair, car, bike, etc. An intangible object could be something like the banking system and objects provide a structured approach to programming.
- Class: A class is a group of objects sharing familiar properties and described as a prototype from which objects are emanated. Due to it being a grouping of objects, a class does not take any space; furthermore, a class is a logical entity unable to be physical
- Inheritance: Inheritance provides a strong and honest means of organizing/structuring your software. Inheritance allows for classes to inherit features from other classes (true to their name). Parent classes develop attributes and behaviors to child classes. This supports reusability.
- Polymorphism: A concept where a single action can be executed in many different ways. An easy example of this is the expression of the same story told in many different mediums like film, books, or television. It is the same story just with different ways of conveying it. In Java, there are two types of polymorphisms: compile-time and run-time. In Java, this can be performed by method overloading and method overriding.
- Abstraction: A process of concealing the implementation elements and displaying only functionality to the intended user. Abstraction means that users interact with only specific attributes/methods of an object (Doherty, 2020). Abstraction in simple terms is employing simple classes to represent complexity. An extension of encapsulation, you do not need to know all the details of the PC you work on in order to properly use it.
- Encapsulation: In encapsulation code and data wrap together into a single unit similar to an actual capsule that contains various medicines. (Java T Point, n.d.). Encapsulation, one of the four pillars of OOP is all about containing information in an object, revealing only specified info.
If you are endeavoring to get into programming you should try your hand in Java. Java is one of the essential software for aspiring programmers and a good way to get introduced to the basics. If you have decided you want to try here is a link for you
https://www.oracle.com/java/technologies/downloads/
Once you have it downloaded an easy exercise for you is the Hello world application which can be viewed here
https://docs.oracle.com/javase/tutorial/getStarted/cupojava/win32.html
You can go to Java tutorials for some instructions on the basics and if there is any trouble with installation you can visit this youtube link which gives a clear explanation on what to do. https://youtu.be/eIrMbAQSU34 Good luck and have fun!
Lesson: Object-oriented programming concepts. Lesson: Object-Oriented Programming Concepts (The Java™ Tutorials > Learning the Java Language). (n.d.). Retrieved January 12, 2022, from https://docs.oracle.com/javase/tutorial/java/concepts/index.html
What is object-oriented programming? oop explained in depth. Educative. (2020, April 15). Retrieved January 12, 2022, from https://www.educative.io/blog/object-oriented-programming
Java Oops Concepts - Javatpoint. www.javatpoint.com. (n.d.). Retrieved January 12, 2022, from https://www.javatpoint.com/java-oops-concepts
Comments
Post a Comment