Thursday, July 20, 2023

Installing Java and Object-Oriented Programming

Getting Started

Learning a new programming language can seem intimidating if you are anything like me. However, as with anything new, it is vital to keep an open mind, take your time, and, most importantly, ask questions and research to find the necessary information. To start your journey with Java, you will need to install it on your computer or laptop, along with an IDE (Integrated Development Environment) to write your code or a code editor. A simple internet search will provide information about many options available. I use a code editor called Visual Studio Code. I chose VSCode because I found it easy to use while learning another programming language, as it provides tips and alerts you of code errors. Below are links to resources that helped me get started with Java. The third link provides information on writing and running a “HelloWorld” program. The program is simple and allows visibility to basic Java syntax to ensure you are on the right track. Hopefully, the below resources will be of help to you as well.

Object-Oriented Programming

Object-Oriented Programming, also called OOP, differs from procedural programming as the code contains both a method and data. Procedural programming is a list of step-by-step instructions telling the code what to do. Of course, OOP is a concept with many moving parts; however, let’s focus on four major components for now. The four parts we will discuss are encapsulation, abstraction, inheritance, and polymorphism.

Encapsulation can be thought of as a way to protect or hide the primary data within a program from specific methods. Two methods will attempt to gain program data; accessors and mutators. Accessors try to gather information related to objects, and mutators attempt to change data.

Abstraction is a way of setting up code so that only its relevance will show up in the software. In other words, abstraction keeps the inner workings or minute details away from view. 

Inheritance, in simplest terms, is a way for objects to share data. Although there may be many data classes, inheritance makes data relatable in a hierarchy so it can be shared.

Polymorphism allows for parameters to be set but not set in stone. For example, a set of functions can be named the same, but each plays a different role in how a task executes.



No comments:

Post a Comment

Data Structures & Algorithms

 Algorithmic Design When developing a program, having a clear idea of how you want it to perform is crucial; that is where algorithmic desig...