Unstoppable Domains

[Resolved] Need help with Java alphabet code

Spaceship Spaceship
Watch

zk0

Established Member
Impact
3
Need help with Java alphabet code

Hi!

I need some help with a JAVA code that is suppose to look like this when it's finished:
aA bB cC dD eE fF gG hH iI jJ kK lL mM nN oO pP qQ rR sS tT uU vV wW xX yY zZ

zZ yY xX wW vV uU tT sS rR qQ pP oO nN mM lL kK jJ iI hH gG fF eE dD cC bB aA

But now it's looking like this:
aA bB cC dD eE fF gG hH iI jJ kK lL mM nN oO pP qQ rR sS tT uU vV wW xX yY zZ {[ |\ }] ~^ _ ?` ?a ?b ?c ?d ?e ?f ?g ?h ?i ?j ?k ?l ?m ?n ?o ?p ?q ?r ?s ?t ?u ?v ?w ?x ?y ?z

?z ?y ?x ?w ?v ?u ?t ?s ?r ?q ?p ?o ?n ?m ?l ?k ?j ?i ?h ?g ?f ?e ?d ?c ?b ?a ?` _ ~^ }] |\ {[ zZ yY xX wW vV uU tT sS rR qQ pP oO nN mM lL kK jJ iI hH gG fF eE dD cC bB aA

This is the code I have:
Code:
public class alfabetet {

	public static void main(String[] args)
	{
		// Denna koden gör så att alfabetet skrivs ut från a till z
		for (char ch = 65; ch <= 122; ch += 1) // repetitionssats
        {
			System.out.printf("%c%c ", ch + 32, ch);
        }
        System.out.println();
        
        // Koden som gör att alfabetet skrivs baklänges börjar här
		for (char ch = 122; ch >= 65; ch -= 1) // repetitionssats
        {
			System.out.printf("%c%c ", ch + 32, ch);
        }
        System.out.println();
		
}
}

Whats wrong!?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
I don't know Java at all, but I'm guessing 122 is the wrong code for z.
 
0
•••
You have the wrong ASCII codes,

Lowercase letters are: 97-122
Uppercase letters are: 65-90
 
0
•••
Thank you all for your help. :)

I've already solved the problem. I just forgot to tell you :/
 
0
•••

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back