How important are the classes? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How important are the classes?

Still finding hard to understand why would we create our own objects.

3rd Mar 2023, 2:03 PM
Miss West
Miss West - avatar
3 Answers
+ 1
You can write your general classes and save them as a library package. Then you can import them into your other projects by a single line, so it saves some time and memory ;) But as an amateur/hobby programmer, it is kinda pointless, I agree - there are more fun and useful things to learn than this, if you are here just for funcionality. Good luck on your Sololearn journey!
3rd Mar 2023, 2:34 PM
Paleon
Paleon - avatar
0
they are very important, basically every framewrok and language are divided by classes per example java in order to take input from user you need Scanner class if you want to use Dates you use Date class if want to use mathematics you use math class every function in java come from a class this classes where created by developers in oracle and now you can use those functions/variables inside the class by creating an object, you can create your one clases with your own funtionality like they did
3rd Mar 2023, 5:20 PM
Oscar Panuko
Oscar Panuko - avatar
0
You don't have too but then you would have lots of code which you could of reused, plus what if you wanted 2 of the same object?
8th Mar 2023, 4:16 PM
D_Stark
D_Stark - avatar