Question :What is the difference between instanceof and isInstance? (CoreJava)
Answer :instanceof is used to check to see if an object can be cast into a specified
type without throwing a cast class exception.
isInstance()
Determines if the specified Object is assignment-compatible with the
object represented by this Class. This method is the dynamic equivalent of
the Java language instanceof operator. The method returns true if the
specified Object argument is non-null and can be cast to the reference type
represented by this Class object without raising a ClassCastException. It
returns false otherwise.
www.interviewhelper.org is a hope for all the Job seekers. Users can find unlimited here. These range from technical to HR, from functional to behavioral. www.interviewhelper.org contains in the fields like Ajax,VB,Networking,Sharepoint,JEE,Perl,Javascript,Bioinformatics,Classic ASP,Unix,Linux,Accounting,Oracle DBA,Microprocessor,Bluetooth,jms,jme,.net framework,ABAP,ASP,ASP.net,Basic .net Framework,Interview Questions,C language,C++,database,Oracle,Java,PHP,LAMP,SAP etc.
Thursday, March 12, 2009
What is the difference between instanceof and isInstance? (CoreJava)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment