File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Puzzle 4 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Puzzle 4" Watch "Puzzle 4" New topic
Author

Puzzle 4

ryan almadin
Greenhorn

Joined: Jul 19, 2012
Posts: 9
Hi i have a question on this code.

Help me guys to understand it clearly thanks.
Rameshwar Soni
Ranch Hand

Joined: Feb 03, 2011
Posts: 247
@ryan

1) Whenever you have a new question, then start a new thread i.e. a new topic. But if your doubt is regarding the same concept which an earlier topic had then you can continue in that topic.
Since here you are having a new code, i request you to start a new topic.

2) Whenever you are posting any code here, first press the "code" button which you can see when you are posting a question. After pressing the code button paste your code between the code tags. You are pretty new so this happens.

3) As far as your current code is concerned, i can see 2 problems

i)

See you have written x = x 6

ii) After the class name you have put brackets (parenthesis) i.e.


So correct them.
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7552
    
  18

ryan almadin wrote:Hi i have a question on this code...

Ryan,

Please UseCodeTags (←click) when you are posting code. I've edited yours this time, and see how much better it looks?.
Please read this page thoroughly before you post again, because one of your lines was far too long. I broke it up for you.

Thanks.

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7552
    
  18

ryan almadin wrote:Help me guys to understand it clearly thanks.

We can't help you to understand it clearly unless you post a clear question.

What exactly is it you don't understand about it now?

Winston

PS: I suggest you have a look at the HowToAskQuestionsOnJavaRanch (←click) page.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38045
    
  22
Do you mean how does the puzzle work? What you need to do is to get a pencil and paper and write down the values of all the variables during each iteration of the loop. Then you can see how it works. Note many of these puzzles have little twists in, which are intended to confuse you, so you must be careful.
ryan almadin
Greenhorn

Joined: Jul 19, 2012
Posts: 9
Thanks Sheriff i understand now the Puzzle and i solve it clearly last 2 days thats correct have a little twist but i careful to understand so im happy i solve the problem im study now HFJ @dot com class and im very glad to be part in this family ranch because you guys help me understanding the java and helping me some of my question to @soni and @Gutkowski apologies me on my mistake . thanks
Rameshwar Soni
Ranch Hand

Joined: Feb 03, 2011
Posts: 247
ryan almadin wrote: i understand now the Puzzle and i solve it clearly


Congrats!!!
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38045
    
  22
Well done
Keep reading, and you will be better able to help the next person who has difficulty with such a puzzle.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Puzzle 4
 
Similar Threads
Head First page 92 Pool Puzzle
Head first Java - Chapter 4 Pool Puzzle p.91
Head first programme
Help needen with Pool Puzzle excercise on page 91 Head First book...pleaseee
Head First Java - Chapter 4 puzzle question