Results 1 to 6 of 6
- 04-11-2009, 12:36 PM #1
Member
- Join Date
- Apr 2009
- Posts
- 5
- Rep Power
- 0
-
perhaps you want to look in the Reflection Tutorial.
- 04-11-2009, 02:09 PM #3
Member
- Join Date
- Apr 2009
- Posts
- 5
- Rep Power
- 0
I did
I already did. What I did learn is how to set and retrieve properties but I couldn't figure out how to create a new instance...
Reflection might very well be the right direction but maybe someone can point out te me what I was overlooking in there...
-
Perhaps it would be better for you to describe your ultimate goal rather than this specific step towards your goal. I know that Java and PHP have vastly different philosophies, and what works well in one language often doesn't work well in the other. Please let us know the overall problem you are trying to solve, and perhaps we can find you a better way to solve it from a Java point of view.
Best of luck.
- 04-12-2009, 07:00 AM #5
Member
- Join Date
- Apr 2009
- Posts
- 5
- Rep Power
- 0
Ok, let's try that
Ok, let's try it that way. What I'm trying to do is this:
The application (applet actually) reads a script that describes a customer from IT support perspective. It reads elements that will be represented by objects of different classes. Some o those classes are containers, others are end-nodes. examples are:
- building
- floor/level
- office
- meetingroom
- copier
- computer
- printer
etc...
So my script could be:
Java Code:BUILDING:Mainroad6 FLOOR:Ground Floor OFFICE:0.01 COMPUTER:FG-PC-0005 COMPUTER:FG-PC-0006 PRINTER:FG-PR-0100 MEETINGROOM:0.03 BEAMER:FG-BM-0034 etc...
I expect to have about 80 different objects, so I was hoping to do this whithour switching of if's...
- 04-12-2009, 08:13 PM #6
Similar Threads
-
Array of objects, as an Instance variable
By blaklite in forum New To JavaReplies: 2Last Post: 03-25-2009, 12:56 AM -
create Instance of class in Javascript
By TDMaster in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 03-09-2009, 04:26 PM -
Naming a class instance with a variable
By pikalex88 in forum New To JavaReplies: 3Last Post: 09-30-2008, 06:27 PM -
Instance Variable In Servlet
By javarishi in forum Java ServletReplies: 3Last Post: 06-14-2008, 08:28 AM -
Instance variable
By Jack in forum New To JavaReplies: 2Last Post: 07-04-2007, 04:00 AM
Bookmarks