Back to posts

Java installation guidance and Object Oriented Programming (OOP) fundamentals

7/1/2022

 

Hello there, so you want to install Java on your computer and write some amazing code? Great! You've come to the right place. First you would need to download the Java Development Kit which you can find here JDK Downloads. Second you need an integrated development environment (IDE), there are multiple IDEs to choose from but the one I recommend is the Apache NetBeans which you can download here NetBeans. You're all set, now is where the fun part begins.

What is Object Oriented Programming?

Object Oriente Programming (OOP) is all about creating classes referred to as objects which make visualization easier since it is like things in the real world. Objects in a program can be a car, a bike, or a bank account, etc. These objects will be composed of variables and functions, in Java these are referred to as the object's properties and methods. Some examples for properties of a bank account object would be the balance, account number, account holder, and its methods which describe the object's behavior, would be actions like withdraw, deposit, and transfer.

There are four fundamental principles of OOP, inheritance, polymorphism, abstraction, and encapsulation (Singh, H.S., 2020). Inheritance is where a class or an object inherits properties, or methods from a parent class, this provides code reusability. Polymorphism means many forms, say for example there is a method called "describe", which describes the current object, when there are multiple objects they can all have the same method "describe", but the results are different on each instance depending on the object that is calling it. To understand abstraction, think of an ATM machine, when you press a button, it goes through all these programming and calculations, however you as the user do not have to concern yourself with these processes, all you really need is for the money to come out. In a program, an object may have private properties and methods that the user does not have to worry about, making it a simpler interface. Lastly, encapsulation, this is where you take all related properties and methods and put them together into an object, this is a way to ensure security, if someone uses your object for their program, in order to modify the object, they would have to go through methods and rules you intended, rather than changing properties as they please, this is also known as information hiding.

References

Singh, H. S. (2020, September 1). Basic concepts of Object-Oriented Programming. Analytics Vidhya

    retrieved from https://www.analyticsvidhya.com/blog/2020/09/object-oriented-programming/#h2_3