new Operator
- new operator is used to create a new object for a class.
- It returns the address of the newly created object.
Lab150.java
class Hello {}
class Hai {}
class Lab150 {
public static void main(String[] args) {
Hello h1 = new Hello();
Hai h2 = new Hai();
System.out.println(h1);
System.out.println(h2);
}
}