5. Creating Classes

Drum roll please! It’s the moment we have all been waiting for.

Suspense


It’s time to create our own classes in Java!

Epic, right? Just in case you forgot, a class is the collection of attributes and methods we can use to create objects. Why would we care about making our own objects though?

Creating classes from scratch gives you the power to make your own data types, which means the the world instantly becomes your oyster. Working on a pet grooming app that needs a Dog data type? No problem, you can create it with a new Dog class! Are you an engineer working for SoundCloud that needs a Song data type? Again, no problema! You can create your own Song class if you feel like it. Classes in Java gives you the ability to literally describe anything in the world.

Now do you believe me?

Suspense


The first day of the rest of your life begins on the next page.