Instance of operator: The java instance of operator is used to test whether the object is an instance of the specified type (class or subclass or interface).
The instance of in java is also known as type comparison operator because it compares the instance with type. It returns either true or false. If we apply the instance of operator with any variable that has null value, it returns false.
Example
class Simple1{
public static void main(String args[]){
Simple1 s=new Simple1();
System.out.println(sinstanceofSimple1);//true
}
}
dot (.) operator: The dot operator, also known as separator or period used to separate a variable or method from a reference variable. Only static variables or methods can be accessed using class name. Code that is outside the object's class must use an object reference or expression, followed by the dot (.) operator, followed by a simple field name.
Example
this.name=”john”; where name is a instance variable referenced by
‘this’ keyword
c.getdata(); where getdata() is a method invoked on object ‘c’.