{"id":1340,"date":"2021-07-18T03:17:21","date_gmt":"2021-07-18T03:17:21","guid":{"rendered":"http:\/\/localhost\/wordpress\/?page_id=1340"},"modified":"2021-07-18T04:14:52","modified_gmt":"2021-07-18T04:14:52","slug":"lesson","status":"publish","type":"page","link":"http:\/\/localhost\/wordpress\/lesson\/","title":{"rendered":"Lesson"},"content":{"rendered":"\t\t
Offers a sustainable way to write spaghetti code and lets you accrete programs as a series of patches<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t Abstraction means using simple things to represent complexity. This is the practice of keeping fields within a class private, then providing access to them via public methods. It lets programmers create new classes that share some of the attributes of existing classes. This lets us build on previous work without reinventing the wheel. For example, you could create the class Car that specifies wheels = 4 and a subclass Sedan that includes the attribute doors = 4. The flow of inheritance relationships often reflects the logical relationship similar to squares and rectangles; in this case, all sedans are cars, but not all cars are sedans. This concept lets programmers use the same word to mean different things in different contexts. For example, the human body has different organs. Every organ has a different function to perform; the heart is responsible for blood flow, lungs for breathing, brain for cognitive activity and kidneys for excretion. So we have a standard method function that performs differently depending upon the organ of the body.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\tWhat is OOP?
<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
What the four basic OOP Programming?<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
1. Abstraction.<\/strong><\/p>
Example: A car in itself is a well-defined object, which is composed of several other smaller objects like a gearing system, steering mechanism, engine, which are again have their own subsystems. But for humans car is a one single object, which can be managed by the help of its subsystems, even if their inner details are unknown.
2. Encapsulation.<\/strong><\/p>
An example of encapsulation is the class of java.util.Hashtable. User only knows that he can store data in the form of key\/value pair in a Hashtable and that he can retrieve that data in the various ways. But the actual implementation like, how and where this data is actually stored, is hidden from the user. User can simply use Hashtable wherever he wants to store Key\/Value pairs without bothering about its implementation.
3. Inheritance.<\/strong><\/p>
4. Polymorphism.<\/strong><\/p>
Object-Oriented Requirements Models<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\nThe models requires in OOP are class model, state model, and interaction model. The class model shows all the classes inside the system. The state model, defines the actions inside of a state diagram. The interaction model is used to show various interactions between objects, one of example of this is Sequence Diagram. In object-oriented requirements analysis, you should model real-world entities using object classes. You may create different types of object model, showing how object classes are related to each other, how objects are aggregated to form other objects, how objects interact with other objects and so on.\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\nTasks\n
<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\nYou need to design a Vending Machine which\n\n \t
\n