I'm stuck learning classes and objects in java | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I'm stuck learning classes and objects in java

I can't seem to understand how classes and objects realy work and it's been weeks and it seems that I am not going anywhere. It is also similar to python the classes and objects part i just cant understand even though i kept on repeating on reading I'm just not going anywhere and it is frustrating me. Is it realy just hard to learn that part or is it realy just me being slow and dumb? Please i need help on this.

26th Nov 2020, 3:04 PM
Mr Cat
Mr Cat - avatar
3 Answers
+ 4
You are committing (sorry) a suicide by mixing up Java, C++ and Python all together (plus some other courses joined as well). Difference in syntax is enough a trouble already, and you went with three languages, I was surprised you can still keep your soberness. My suggestion for you buddy, focus on one language at a time. That is, if you'd like to stay sane.
26th Nov 2020, 3:26 PM
Ipang
+ 2
Hi Mr Cat, You may find this helpful... https://www.youtube.com/playlist?list=PL-osiE80TeTsqhIuOqKhwlXsIBIdSeYtc This playlist is for OOP in Python. I found it really helpful. Also, I would personally recommend you to learn only one language at a time... Maybe Python 'cause it's easier than Java.
26th Nov 2020, 4:52 PM
Rahul Hemdev
Rahul Hemdev - avatar
+ 2
I will keep it short. Consider class as a blueprint to build something. On the other hand object is something that is build out of that class. To create a class Dog you say- class Dog{ } Now let us consider that a dog has a color and a sound. class Dog{ String color; public void sound(){ System.out.print("woof"); } } In Java that color is called a state and the sound method is called a behavior. Now let us see how to create an object. Dog dog1 = new Dog(); Dog dog2 = new Dog(); Here the new keyword creates a new Dog for you. So you are basically creating multiple dogs with different names. This was a small example. Go through it once again and then read or watch a tutorial, you will understand better.
26th Nov 2020, 7:48 PM
Avinesh
Avinesh - avatar