0

1. Why do we need objects in java? (2.) Why do we need methods in java? ... Thanks expecting your reply soon

5th Jul 2018, 5:30 PM
Efe Panama
3 odpowiedzi
+ 2
Because it's much easier to code and keep a project organized using objects (OOP model) than a traditional procedural model. Do some research about OOP and you will understand why it is so useful and why it actually replaced the old approach to programming.
6th Jul 2018, 7:46 AM
Dev
Dev - avatar
+ 2
I will give examples here: Because it maps nicely to real objects in the real world like object person, car, house(house class I.e an architects blueprint can be used to design several house objects). These objects can then perform actions. Like walk, drive etc(We call these doing verbs, methods) . Objects like car have to be first manufactured from a factory and made available to you through a dealership(interfaces) to pick and use them and pick up another one anytime (implementing interfaces)
14th Jul 2018, 11:00 AM
Benard Omondi
Benard Omondi - avatar
+ 1
➡May be coz you haven't finished the course properly ➡ You can find nice example+definition on course ➡object ✔ https://www.sololearn.com/learn/Java/2151/ ➡ method ✔ https://www.sololearn.com/learn/Java/2152/
5th Jul 2018, 5:33 PM
Sudarshan Rai
Sudarshan Rai - avatar