Results 1 to 5 of 5
- 05-01-2011, 03:48 PM #1
Member
- Join Date
- Mar 2011
- Posts
- 11
- Rep Power
- 0
Dynamic variable name based on other variable
Here is my problem:
How can i get the data found in String word and pass it as a name for another object??System.out.print("Enter a string");
String word = input.next(); -> Assume input is a scanner already defined
Object word = new Object (...); -> this word here is the data found in String wordGlad to be of help
(if you could check on my problems too :) )
- 05-01-2011, 06:45 PM #2
You can't.
Maybe you want a Map.
db
- 05-03-2011, 11:00 PM #3
Member
- Join Date
- Mar 2011
- Posts
- 11
- Rep Power
- 0
what do you mean by a map?
you mean something like create a hashmap and pointing my 1st object to the 2nd one?Glad to be of help
(if you could check on my problems too :) )
-
- 05-06-2011, 06:22 PM #5
Member
- Join Date
- Mar 2011
- Posts
- 11
- Rep Power
- 0
Similar Threads
-
"dynamic variable naming" ?
By N00Bie in forum New To JavaReplies: 7Last Post: 02-18-2011, 04:10 PM -
Alternating Transparency Based on Double Variable
By YellowPainting in forum Java 2DReplies: 2Last Post: 11-05-2010, 08:59 PM -
How to update with dynamic variable?
By mr_anderson in forum JDBCReplies: 9Last Post: 08-09-2010, 08:40 AM -
How do I substitute any variable for a hardcoded variable
By Weazel Boy in forum New To JavaReplies: 11Last Post: 07-07-2010, 06:02 AM -
Dynamic types for a variable.
By Somelauw in forum New To JavaReplies: 5Last Post: 11-27-2009, 10:38 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks