03 May Read the post below and respond with 150 words. Object-oriented programming is a model of prog
Read the post below and respond with 150 words.
Object-oriented programming is a model of programming that is often used to create programs that are simple, efficient, and easy to maintain. The way that object-oriented programming achieves this is by breaking a complex problem down into smaller, simpler problems. It uses a hierarchical inheritance approach–meaning that the sub classes (or child classes) of a class can access all methods from the parent class.
A class is utilized as a type of blueprint for objects to be created, and is basically a collection of similar objects. For example, a "Computer" might be considered a class, while it's objects might be 3 different computers: a Lenovo, a Dell, and an Acer. We can declare variables in the class, and then define what attributes that the objects in the class "Computer" will share, such as cost, color, and brand. The "state" of an object is considered to be something that describes an object, such as the three attributes we listed above. The "behavior" of an object is considered to be something that the object "does", such as a computer "running".
Within the class, a main method as well as other methods are created which utilize objects, statements, and commands to achieve a desired result. There must be at least one main method in the program so that the system knows where to begin executing the program. I have attached an example of a small program that creates a class of "Computer1" which declares two variables: cost and brand. I then create an object called "myComputer" which utilizes those variables to show the cost and brand of my computer, and to display the result along with a string as the output.