ByteBrawl - Class - Concepts To Know - Java Basics

Concepts To Know - Class

Class

Classes are containers for functions and variables. They can be used to group related code and organize data.

Note: Variables defined at the top of a class (like myString here) are called fields.

Classes are a more complex topic that we will break down further as we go on. Here, you can see the Main class has a variable and a function (also known as a method of a class). In the next section, we will use a similar example to explore a Java file.