new keyword in java

The ” new ” keyword is used to create a new instance or new object of a class. Example String str = new String("Welcome to Java new keyword"); String str = new String(“Welcome to Java new keyword”); Create custom class and object class Vehicle { } Vehicle vehicle = new Vehicle();   class Person { […]

Share this article on