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

Java help (I know, I know java sux lol)

Name: Anonymous 2010-06-18 17:28

I'm trying to take a line in single character input and if it's uppercase, switch it to lower case and vice versa.
System.out.print ("Enter character: "); 
             s=stdin.readLine();
             c[i]=s.charAt(0);
             k=(int)c[i];
             if(k>96)
        {
                Character.toUpperCase(c[i]);
        }
             else
        {  
                Character.toLowerCase(c[i]);
        } 
             i++;
         }
         while(k!=46);

Everything else works right, but that doesn't flip it. HALP
<3

Name: Anonymous 2010-06-18 19:26

>>9
I was going to say that it could be an attempt at getting competent help by >>1, because while /prog/ hates helping people who don't deserve it, it hates getting a reputation for incompetence even more, and if someone posts really shit code in an attempt to help, someone else will usually come along to ridicule and correct; but then I noticed that it couldn't be >>1, because >>5-6's code doesn't suffer from >>1's specific problem.
Still, I'm sure it's only a matter of time before someone posts code that's as good as you can get while still writing Java.

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