Professional Documents
Culture Documents
In Java, variables are named storage locations used to store and manipulate
data during program execution. They have names, data types, and values.
• Custom Objects: You can create your own custom reference data types
by defining classes and objects.
Example:
1
class Person {
String name;
int age;
}
Person person = new Person();
person.name = "John";
person.age = 30;
Understanding variables and data types is essential when working with Java,
as it forms the basis for storing and manipulating information in your programs.