Need help with simple program


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Need help with simple program

Hybrid View

  1. #1
    Join Date
    Sep 2005
    Location
    Helsinki, Finland
    Posts
    6

    Need help with simple program

    I need to make a program that displays each char value from a to z, basically listing the alphabet. How exactly would I do this? Should I use the for() method until I reach z?

  2. #2
    Join Date
    Aug 2005
    Posts
    43
    each character has a numeric representation...if i'm not mistaken, A=65, B=66, ... Z=90, so you can have a for loop from 65 to 90, casting these ints into chars....

    Code:
    		for(int i=65;i<=90;i++) {
    			System.out.println((char)i);
    		}
    ps. these would print the characters in uppercase letters, look for an ASCII table to see their representation in lowecase.

Similar Threads

  1. Replies: 1
    Last Post: 11-12-2005, 05:37 AM
  2. Network Program Help
    By thedrew in forum Java
    Replies: 0
    Last Post: 10-12-2005, 10:12 AM
  3. Replies: 7
    Last Post: 04-26-2002, 12:25 PM
  4. The invisible program
    By James Abbott in forum VB Classic
    Replies: 2
    Last Post: 11-24-2001, 06:04 AM
  5. The invisible program
    By James Abbott in forum VB Classic
    Replies: 0
    Last Post: 11-24-2001, 02:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center