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

Java HALP

Name: Anonymous 2011-03-09 18:23

public class life{
    public static void main(){
        char[] alphabet = new char[26];
        for(int i=0;i<26;i++){
            alphabet[i] = ((char)(i+97)); //Sets the lowercase ASCII letter to it's position in the aplhabet
            System.out.println((char)(i+97));//Displays the letter
        }
        System.out.println(alphabet[0] + alphabet[25]);//should return "az"
    }
}

I'm using a for loop to build an array containing the alphabet. It doesn't work.

Name: fuck you faggot 2011-03-09 18:36

fuck you faggot

Name: Anonymous 2011-03-09 18:41

Yeah, that happens. Try rebooting your computer.

Name: Anonymous 2011-03-09 19:04

That's because 219 isn't a printable character.

Name: Anonymous 2011-03-09 19:49

Changed

>(alphabet[0] + alphabet[25])

to

(alphabet[0] + "" + alphabet[25])

Thanks bro
>>4

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