• Post Reply Bookmark Topic Watch Topic
  • New Topic

Tracing Code That Prints Without Print Statement  RSS feed

 
Recaip Sanli
Ranch Hand
Posts: 72
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am confused how some of lines in this java prints something even though there is not something like System.out.print();
To be specific, lines I am confused why they appear in the output are: 1,5,6

Stars.java


StarsTest.java


Output
 
Dave Tolls
Ranch Foreman
Posts: 3056
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
line 1 comes from here:

in the Stars constructor.

Line 5 comes from here:

the second line of your main() method.

and line 6 comes from here:

after the call to starStuff(7).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!