Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Re: Blue Pelican Java- Array of Hope; char array for loops?

  1. #1
    Junior Member ZaneDarklace's Avatar
    Join Date
    Feb 2014
    Location
    Lawton, OK
    Posts
    15
    My Mood
    Lonely
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Exclamation Re: Blue Pelican Java- Array of Hope; char array for loops?

    i am working on the same project and i got the code to make them print going down but not sideways.

    public class ArrayofHope
     {
      public static void main(String args[])
     {
       System.out.println("Decimal\t\tCharacter\n");
       for(int j = 65; j <= 90; j++)
       {
         System.out.print(j);
         System.out.println("\t\t" + (char)j); //Character
       }
      }
    }
    Rock On


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,879
    Thanks
    55
    Thanked 2,347 Times in 2,318 Posts

    Default Re: Blue Pelican Java- Array of Hope; char array for loops?

    Moved to own thread.
    Please start your own thread for your problem.

    Do you have any specific questions?
    Post the program's output and add some comments showing what you want the output to look like.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Member
    Join Date
    Feb 2014
    Location
    India
    Posts
    47
    My Mood
    Bored
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Default Re: Blue Pelican Java- Array of Hope; char array for loops?

    i dont clearly know what your problem is but if i have understood right, you can have sideways printing by using
    System.out.print()
    System.out.println() prints the next string or value in the new line hence printing going in the downward direction.
    if you have more problem, be a little more specific.

  4. The Following User Says Thank You to ankurt For This Useful Post:

    ZaneDarklace (February 14th, 2014)

  5. #4
    Junior Member ZaneDarklace's Avatar
    Join Date
    Feb 2014
    Location
    Lawton, OK
    Posts
    15
    My Mood
    Lonely
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Blue Pelican Java- Array of Hope; char array for loops?

    the code i posted creates an array of decimal numbers 65 - 90 on the left hand side and they print straight down. i have a code next to it that prints characters a - z and they go straight down. i would like to have it to where the decimal prints left to right then the characters print left to right under it. That is the issue i am having.

    --- Update ---

    I have a completed code. This one works now. Thankyou for all the help.
    public class ArrayofHope
     {
      public static void main(String args[])
      {
       System.out.println("Decimal");
       for(int a = 65; a <= 90; a++)
       {
         System.out.print(a + ",");
       }
       {
         System.out.print("\n");
         System.out.print("\n");
       }
      {
       System.out.println("Character");
       for(int j = 65; j <= 90; j++)
       {
         System.out.print((char)j + ",");
       }
      }
     }
    }
    Rock On

Similar Threads

  1. Char array to a String array with hex
    By fortune2k in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 20th, 2014, 01:01 PM
  2. Blue Pelican Java- Array of Hope; char array for loops?
    By Draco579 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: February 19th, 2014, 11:37 AM
  3. Help with java char Array
    By ashboi in forum What's Wrong With My Code?
    Replies: 4
    Last Post: November 9th, 2012, 10:46 AM
  4. How do I compare between the array of char and array of words !!?
    By bady2050 in forum Collections and Generics
    Replies: 1
    Last Post: May 5th, 2012, 06:36 PM
  5. [SOLVED] Java program to sort arrays containing dates
    By scottyadam in forum Collections and Generics
    Replies: 1
    Last Post: March 9th, 2009, 07:08 PM