• Post Reply Bookmark Topic Watch Topic
  • New Topic

Intrepretation of code  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I am just learning Java and I have come across this class file:


[color=darkred]package MikesJavaFiles;


[/color]

The result is:

14 1


I want to confirm where the 14 is coming from as there is a lot going on with methods and objects. I understand that the "1" comes from the value in the first array for x = 1, but want to fully understand where the "14" is generated from. I get that the loop X < 5 returns 5 to the main class Mix4 and the loop x < 9 returns 9 from the counter + 1 instruction. Can someone explain this to me?

Thanks


 
Mike Mirabelli
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see that there is already a post about this (with reference to the book HeadFirst Java) - https://coderanch.com/t/584859/java/explain-script

My question has been resolved.
 
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch and well done finding the solution elsewhere.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!