12GETTING CLASSY WITH OBJECT-ORIENTED PROGRAMMING

image

Reusability is a very important aspect of programming. It saves time and effort. You’ve seen this with loops and functions, and now you’ll learn about object-oriented programming.

Object-oriented programming is an approach to programming that groups functions and variables together to create classes. Each class can be used to create objects that share the same variables and functions as the class. You can create many objects from the same class, making the class’s variables and functions reusable.

When a function is part of a class, it’s called a method, and a variable that’s part of a class is ...

Get Learn to Program with Minecraft now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.