This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the difference between isInstance() and newInstance() ?

 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the basic diff bet them
 
Sridhar Santhanakrishnan
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the java docs,


isInstance(Object obj)
Determines if the specified Object is assignment-compatible with the object represented by this Class.



newInstance()
Creates a new instance of the class represented by this Class object.


Is there anything specific that you didnt understand?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prabhat Ranjan wrote:What is the basic diff bet them

Please UseRealWords.
 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Christophe Verré wrote:
Prabhat Ranjan wrote:What is the basic diff bet them

Please UseRealWords.


mean "What is the difference between them"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic