new Operator in java

new Operator in java
new operator is often used to create object to classes.It allocates memory dynamically for an object.

Classname object = new Classname();

An object is the variable of the class type being created. The Classname is the name of the class that is being instantiated.

employee emp = new employee();

Leave a Reply

Your email address will not be published. Required fields are marked *