Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

run time  RSS feed

 
eswar kumar
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do u create an instance of class at run time?
 
Tom Wolve
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
try using 'new'.
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eswar,
Am I correct in assuming that you are trying to learn how to build software systems using java, only through the JavaRanch forums?
Your question is not clear (to me). Are you referring to the java.lang.Class class? If you are, then there are two methods (that I know of):
  • Use the "getClass()" method (in class Object).
  • Get the (static) "class" member.


  • By the way, I really think there are better ways to learn how to develop software using java, than through the JavaRanch forums
    Good Luck,
    Avi.
     
    It is sorta covered in the JavaRanch Style Guide.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!