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 16:34

>>12
>Sees somebody can't ride a bike on their first try
>Riding bikes is not a worthwhile pursuit for you

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