Today we will Know the Difference Between the InstanceOf Operator and getClass Method.
What is GetClass Method?
getClass() method is a Method in the Class Object.
Where it returns the RunTime class of an Object.
What is InstanceOf operator then ?
1) We can use it to test if an object is an instance of a class
so we can use InstanceOf Operator instead of getClass method.
like to check whether this object is the Instance of given Class.
No comments:
Post a Comment