We can’t instantiate an interface in java . We can create object of the implemented class .But the instance of Interfaceinterface Pet{public void test(); } class Dog implements Pet{public void test(){System.out.println("Interface Method Implemented");}public static void main(String args[]){Pet p = new Dog();p.test();} }
An object is a basic concept of oops like java classes .objects like an entity, which has a state and behavior. Objects represent identity, which uniquely identifies it. Like one car number plate is a different number of other cars. so, it is the car’s identity which is unique.In Java new keyword is used to create an object.
Syntax:
<class-name> [object-name] = new <class-default-constructor>
For a detailed tutorial about Objects in Java, visithttps://www.c-sharpcorner.com/article/a-complete-java-classes-tutorial/