Wednesday, August 4, 2021



Hello, and welcome back to the blog. If you are new to programming, this is a good place to start. This post will go over object oriented programming, how to download the programs you will need and how to create a simple program.

Object oriented programming (OOP) is techniques and guidelines that are used to create a program that uses objects. An object is an item in the physical world. Essentially an Object-Oriented Programming System (OOPs) is a way to make a program that utilizes classes and objects. An object can be thought of as an instance of a class. One example of this when comparing it to the real world is a box of crayons. The crayons are objects in the box, which is the class. The class is the collection of crayons, the objects.  (JavaPoint, n.d.).

If wanting to practice with java, it will need to be downloaded. Here is a link to download java:

https://www.java.com/en/.  

You can click on download and then agree and start free trial. The folder will download, and then find the folder, likely called downloads. After unzipping it, then it will install the latest version of java.

It will also require a program to run and test it. The IDE I used was intellij. Here is the link for this:

https://www.jetbrains.com/idea/. I clicked download in the upper right and then chose the community version. After it was downloaded, I clicked the folder (in downloads again), and allowed it to make changes to my computer. I opened the program, and it let me create a new project.

After you get the IDE, you can make a new program. This super simple program tutorial is located at this link: https://docs.oracle.com/javase/tutorial/getStarted/index.html. It can be followed to make the simple program hello world.

Here are some key concepts that are related to programming with java:

Inheritance is when an object takes on all the characteristics of a parent object. This can help to accomplish runtime polymorphism and codes can then be reusable. Polymorphism just means one job done in various ways. Just like love in English is the word love, in French it is amour.

Encapsulation is when each class has their own private capsule. The data and code are tied together in a unit. This keeps the data safe by making the variables private. The data can still be accessed via a method.

One method that is utilized to ask an object about itself is the assessor. When looking at OOP, this most often is a type of property. The assessor process is seen as a “get” method. This is just an example, and an assessor can be any method that gives information about the state of the object.

Abstraction is  focusing on the important stuff. It can be thought of as a little group of methods known publicly. They are methods which any other class can use, but they don’t even have to know how they work (raymondlewallen, 2005).

The mutators are methods that are public. They can change the object’s state, but it hides precisely how it did this. The mutators are usually part of an abstraction, but its considered the set method. This allows it to work in the background (raymondlewallen, 2005).

I hope this helps any new programmers!

References

JavaPoint. (n.d.). Java OOPs Concepts. Retrieved from JavaPoint: https://www.javatpoint.com/java-oops-concepts

raymondlewallen. (2005, July 19). Codebetter.com. Retrieved from 4 major principles of Object-Oriented Programming: http://codebetter.com/raymondlewallen/2005/07/19/4-major-principles-of-object-oriented-programming/

No comments:

Post a Comment