A new keyword creates a new object, binds variables and functions, and returns that object. The example below shows how to use the new keyword to create an instance of the prototype User. In this example, user1 is an instance of the prototype User, and the properties of the prototype have been assigned to user1.
The new keyword creates a new object by allocating memory in the memory disk. This keyword is useful in array creation. It can also be used as a modifier to hide methods. In addition, new is a common constructor in Java. For example, it can specify a default constructor for a class. The new keyword can be very versatile and be used in a variety of ways. There are several types of new keyword in Java.