Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Filling arrays in Java

Name: Anonymous 2011-11-19 13:45

Sup /prog/?

I am working on a small password generator in Java, and I need some help filling a char array.

Basically, I need to fill it automatically with numbers that will relate to the ASCII values of 33 - 126.

I want to do this with a for loop, and so far all I have is this

for(int i = 0; i < charArray.length; i++)
        {
            charArray[i] = (char)(i + 1);
            System.out.println(charArray[i]);
        }

As you can see, that starts filling it so that element 0 has a value of 1, element 1 has a value of 2, etc. I need it to start at 33 and then increment by one, so element 0 has a value of 33, element 1 has a value of 34, etc.

Can anyone tell me how I would do this? I know this is a total noob question, I'm just stuck.

Name: Anonymous 2011-11-19 20:05

>>23
I bet the authors of SICP would wanna kick the shit out of if they found out you read this book only to end up working some shit hourly job at some hick firm.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List