Sunday, October 10, 2010

InstanceOf Operator vs GetClass Method in java

HI
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:

AWS certification question

AWS AWS Hi! this is for questions related to AWS questions. EC2 instances EC2 storage types cold HDD : 1. Defines performance in terms...