When you use the keyword new
for example JFrame j = new JFrame();
you are creating an instance of the class JFrame
.
The
new
operator instantiates a class by allocating memory for a new object and returning a reference to that memory.
Note: The phrase "instantiating a class" means the same thing as "creating an object." When you create an object, you are creating an "instance" of a class, therefore "instantiating" a class.
Take a look here
Creating Objects
The types of the Java programming language are divided into two categories:
primitive types
andreference
types.
Thereference
types areclass
types,interface
types, andarray
types.
There is also a specialnull
type.
An object is a dynamically created instance of aclass
type or a dynamically createdarray
.
The values of areference
type are references to objects.
Refer Types, Values, and Variables for more information