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: New to Java, Shape Won't Show in Console

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default New to Java, Shape Won't Show in Console

    ba.jpg

    I pieced together the code from different parts of this beginners book Im using ("Big Java") and when I input it all I get is the text describing the shape.
    Is it because println doesnt draw shapes, or because they wont show in the compiler's console (Im using Eclipse)? Or possibly a programming error?

    Any help appreciated


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: New to Java, Shape Won't Show in Console

    System.out is a PrintStream (see PrintStream (Java Platform SE 6)) - it prints out values of primitives or uses an Objects toString method. It does not take an argument like a Rectangle and print out a Rectange to the console (except printing out what the toString() value of that object produces). You will have to do this manually using loops and characters.

  3. #3
    Junior Member
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: New to Java, Shape Won't Show in Console

    Thanks for the response!
    Would it be simpler to print it on a Window thing than using loops and characters? I've only been programming for 2 days.

  4. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: New to Java, Shape Won't Show in Console

    Quote Originally Posted by BulgeBracket View Post
    Thanks for the response!
    Would it be simpler to print it on a Window thing than using loops and characters? I've only been programming for 2 days.
    I have no idea, since I do not know what your requirements are.

Similar Threads

  1. Java Tip Jul 29, 2010 - Swing Console Component
    By helloworld922 in forum Java Swing Tutorials
    Replies: 6
    Last Post: April 16th, 2014, 12:08 AM
  2. can someone show me how to change speed of an java engine.
    By codenoob in forum Java Theory & Questions
    Replies: 19
    Last Post: December 14th, 2011, 12:26 PM
  3. Java web console with Java Native interface
    By rcbandit in forum Java Native Interface
    Replies: 1
    Last Post: August 22nd, 2011, 08:12 AM
  4. Beginner: Show Image in Label when Results Show Up
    By Big Bundy in forum Java Theory & Questions
    Replies: 3
    Last Post: April 4th, 2011, 02:43 PM
  5. Java Tip Jul 29, 2010 - Swing Console Component
    By helloworld922 in forum Java Code Snippets and Tutorials
    Replies: 2
    Last Post: August 24th, 2010, 06:48 AM