Results 1 to 2 of 2
Thread: Keeping data in memory
- 11-01-2010, 11:37 PM #1
Member
- Join Date
- Sep 2010
- Posts
- 20
- Rep Power
- 0
Keeping data in memory
Hello,
I am writing a program that automatically generates letters, requests the user to enter and compared with one another, but at the time of the comparison, they are no longer there, only the latter is kept in memory. How can I do for store all caracters?
ThanksJava Code:static int aleatoire; static Random generateur = new Random(); final static char[] lettresAleatoires = { 'R', 'B', 'O', 'V', 'J', 'F', 'I', 'N' }; for (int i = 0; i < 3; i++) { genererLettres(); } private static void genererLettres() { aleatoire = generateur.nextInt(8); System.out.println(lettresAleatoires[aleatoire]); // Here I put the letters in a table, but I don't know how to do this }
-
You store things by putting them into variables including simple primitive variables, reference variables, arrays, collections such as array lists, and so forth. Your code above won't compile, by the way as you appear to have a for loop hanging in no-man's land.
Similar Threads
-
Keeping a graphic central
By Josisco in forum AWT / SwingReplies: 1Last Post: 10-24-2010, 06:38 PM -
loading data in memory
By robby14 in forum Advanced JavaReplies: 10Last Post: 04-18-2010, 02:29 PM -
Problem with keeping values into an arrayList
By Daniel Silvester in forum New To JavaReplies: 0Last Post: 12-02-2009, 01:14 AM -
Java Keeping Text in One Place
By xpngamer in forum New To JavaReplies: 1Last Post: 04-09-2009, 06:27 AM -
how do I increase memory allocated to code cache (Non Heap Memory)
By manibhat in forum Advanced JavaReplies: 2Last Post: 08-21-2008, 07:33 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks