Hea guys...Please objects, classes and methods are giving me a hard time. Its been a really hard nut to crack. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Hea guys...Please objects, classes and methods are giving me a hard time. Its been a really hard nut to crack.

26th Jul 2017, 3:30 PM
Mo'
Mo' - avatar
2 Answers
+ 3
You can think of classes like the general term for a group of objects. Example; we can have a class called Students. Then under the class students, we can have objects. These objects refer to specific students. So "mike","John","Mohamed" can all be objects of the class students. Similarly, we can have a class called vehicles and then under this class we can have objects of specific cars. So the objects under the class " vehicles" can be "BMW" , "Porsche" and "Honda" . Now methods are just actions that an object can do. For example, you are an object, you can run, you can jump, you can see. So we could make the following methods for you(since you are an object); public void Run(){ System.out.println("You can run"); } another one could be; public void Eyes(){ System.out.println("You can see");
26th Jul 2017, 3:58 PM
Mogammad Shameer Losper
Mogammad Shameer Losper - avatar
+ 1
Just practice more and you will understand it
26th Jul 2017, 3:33 PM
Eligijus Silkartas
Eligijus Silkartas - avatar