Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Tracing Code That Prints Without Print Statement  RSS feed

 
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
 
Rancher
Posts: 3385
38
  • 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!