質問

i have been reading about this topic , and the more i read the more confused i get ,

can somebody please elaborate , we were using language C which follows structural approach , so what was wrong with this approach , that we moved to create a object oriented language JAVA .

I have been reading so many theoretical aspects , can some body please give more of a few practical illustrations , WHY WE NEEDED OBJECT ORIENTED APPROACH IN THE FIRST PLACE

I am not looking for an answer to be given in any interview or tutorial I am looking for an answer to get the better understanding/practical importance of object oriented aproach

役に立ちましたか?

解決

There are many explanations regarding this. But I would like to refer this

  1. Modularity: The source code for a class can be written and maintained independently of the source code for other classes. Once created, an object can be easily passed around inside the system.
  2. Information-hiding: By interacting only with an object's methods, the details of its internal implementation remain hidden from the outside world.
  3. Code re-use: If a class already exists, you can use objects from that class in your program. This allows programmers to implement/test/debug complex, task-specific objects, which you can then use in your own code.
  4. Easy Debugging: If a particular object turns out to be a problem, you can simply remove it from your application and plug in a different object as its replacement. This is analogous to fixing mechanical problems in the real world. If a bolt breaks, you replace it, not the entire machine.
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top