First, there are no loops in the code above - only conditionals. Second, I don't understand your question . What excatly are your doubts about the code?
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
I think the results of the three code segments are quite clear: Segment one: the value won�t be printed out. Segment two: the value won�t be printed out. Segment three: the output should be twenty four. My understanding to these three code segments is: Maybe they are illustrating some basic logic implementing with Java.
I believe the output of the first given example will by 21. This is becaue you want to output the value of VALUE if the value is greater than 30 (false), OR if it is less than 40 (true). Since one is true, then the expression evaluates to true, and the value will be printed. The second given code will have no output, since MIN is set to the value of VALUE, it can't possibly be less than VALUE. There are no else statements, so nothing can be printed, and execution would simply continue past the entire block. The last code example would produce 24 as it's output. Be careful with switch blocks, because if there had not been a BREAK statement after the increment in the 20's case, then the output would have been 26. The switch would have dropped through to the 40's case and added another 2 to the total. Hope this helps some, and that it's not entirely incoherent )
first code : result is 21 second code : result is no_result third code : result is : 24 -- Robbies ----------------------------- 1.java IDE tool : JawaBeginer 2.Java Jar tool : JavaJar http://www.pivotonic.com