Results 1 to 6 of 6
Thread: Naming Arrays
- 01-04-2009, 04:37 PM #1
Member
- Join Date
- Jan 2009
- Posts
- 1
- Rep Power
- 0
Naming Arrays
Hi,
Is there a way to name an array from another variable.
If I ask for a name and they give it, can I then use the name from that variable to create a new array named after their name?
i.e. name=john (and use this to create array) int[] john = new int[2];
All help is very much appreciated.
Thanks,
Cs1h
- 01-04-2009, 04:41 PM #2
nope...
Curious... I asked a very similar question a few days ago and the answer is no. The Java compiler needs to resolve variable names at compile time.
[SOLVED] Can variable names be dynamically created?
Luck,
CJSLChris S.
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.
-
also answered in the OP's cross-post in the sun java forums.
New To Java - Naming Arrays
- 01-04-2009, 05:02 PM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 01-04-2009, 06:05 PM #5
Damn !!!
@OP: don't cross post. If you have a question/problem/doubt post it on one forum. If you don't get an answer, then you can post your question on another forum. Cross posting really irritates people (like me).
CJSLChris S.
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.
- 01-05-2009, 04:17 AM #6
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
And me too. Why don't those people wait for a moment and until someone answering to that. Actually they are in hurry, looking the answer in a second. And don't like to read anything as well.
Similar Threads
-
Naming conventions
By tim in forum Forum LobbyReplies: 10Last Post: 11-16-2008, 09:27 PM -
Naming object instances
By oldgit in forum New To JavaReplies: 9Last Post: 02-07-2008, 11:18 PM -
Naming a Class
By Java Tip in forum Java TipReplies: 0Last Post: 12-22-2007, 11:21 AM -
RMI naming problem
By Robbinz in forum New To JavaReplies: 1Last Post: 12-06-2007, 11:32 PM -
Naming conventions
By Java Tip in forum Java TipReplies: 0Last Post: 12-03-2007, 09:53 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks