1 Attachment(s)
New to Java, Shape Won't Show in Console
Attachment 1008
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:cool:
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.
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.
Re: New to Java, Shape Won't Show in Console
Quote:
Originally Posted by
BulgeBracket
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.