Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Create dynamic class  RSS feed

 
Sakthi Kani
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
In java, is it possible to create class dynamically from other class,
for example, In my Test class i am passing one command line value, say its in "name"
In this Test class can i create another class called 'TestName' with one class level attribute called "name" in the TestName?
Thanks,
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure what you are asking. Can you give us an example? Of what you have, and then what you want after?

Henry
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66304
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like what you need is a Map.
 
Himanshu Kansal
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you trying to add an inner class to the top level class at runtime?

Eg:



you want that at runtime, you add an inner class to "A" ?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!