+ 1
How is oops concept helpful for programming
4 ответов
+ 12
Classes are made so that you only have to write the instructions for how your object/objects will work just once.
Once you have a class you can create multiple objects from it each object you make is of the same class but they have diffrent refreneces/locations in memory for example if you have 2 identical apples in real life you know there not the same object because they are in different locations side by side java uses the same principle so if it doesn't make sense in real life it wont make sense in java 😁
+ 10
In object-oriented programs data is represented by objects. Objects have two sections, fields (instance variables) and methods. Fields tell you what an object is. Methods tell you what an object does. These fields and methods are closely tied to the object's real world characteristics and behavior. When a program is run messages are passed back and forth between objects. When an object receives a message it responds accordingly as defined by its methods.
Object oriented programming is alleged to have a number of advantages including:
• Simpler, easier to read programs;
• More efficient reuse of code;
• Faster time to market;
• More robust, error-free code.
+ 9
Java is a Object Oriented language. This means that you design your code around unit of codes called "objects" which loosely resemble real-world object (or concepts). So if you were to write, say, a library management software you'll most likely have these code objects representing books, members, staff but also more abstract concepts such as genre and loan.
This happens to be a very neat way to organize software (and your thoughts). Instead of thinking about your system as a big line-by-line, step-by-step algorithm, you think of it as a set of interacting objects. If done right, each one of these objects can be reasoned about independently from other objects. Each object can be tested in isolation from others and each one can be extended without necessarily affecting the entire system.
0
The Question is: what do you want to do XD