native keyword in java

The ” native ” keyword can be applied to a method to indicate that the method is implemented in a language other then Java such as C or C++. When a method is marked as native, it can not have a body and should end with a semicolon. The Java Native Interface is responsible for […]

Share this article on

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
< Previous Next >