Who can explain what and why "Classes" are needed in Java? Simplest way possible.
Hi, I'm new so go easy ^_^,
I have read through books and tried codingmyself, I can't wrap my head around "WHY" classes are needed in Java and what do they do?
Doesn't the main method do everything anyway? Can't you just tell the main method what to do and everything would work from there?
Then why is "Aggregation", "Composition" and "Inheritance" needed? Why can't we just add it in to the superclass?
It seems that Java just makes itself so complex when matters can be done through the main methods. It seems that the classes are useless?
Please explain to me what and why are Classes used in Java. What do they do? What are the getter and setter methods? What do they get? And what do they set?
What are constructors? Why can't we just initialise a variable and end it at that?
Please help me! I am so confused!
Thank you so much,
Zukky.