Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

conditional code and condition difference

Hi,

i am looking at below example

http://www.tutorialspoint.com/java/java_continue_statement.htm

I am not clear on difference between conditional code and condition as given in diagram there with respect to below code

ublic class Test {

   public static void main(String args[]) {
      int [] numbers = {10, 20, 30, 40, 50};

      for(int x : numbers ) {
         if( x == 30 ) {
	      continue;
         }
         System.out.print( x );
         System.out.print("\n");
      }
   }
}
This would produce the following result:

10
20
40
50

Open in new window


i am thinking codition is if( x == 30 )

not sure what is conditional code again??

please advise
Avatar of phoffric
phoffric

Your question is reasonable given the link you are trying to understand. Assuming that the rest of the java tutorial of your referenced site has the same clarity has your particular page, my advice is for you to avoid this site:
http://www.tutorialspoint.com/java/

How they can take a simple idea and convolute it is beyond my understanding. That flowchart really sucks.
not sure what is conditional code again??

Conditional code would just be a block of code that may or may not be executed, based on the result of the condition.
Avatar of gudii9

ASKER

Conditional code would just be a block of code that may or may not be executed, based on the result of the condition.

in this example what it is?

what is the meaning of that flow diagram if it has any meaning to it?
How they can take a simple idea and convolute it is beyond my understanding. That flowchart really sucks.

I agree. It doesn't show anything useful. It would be best to send feedback to the authors of that flowchart.
The site u are referencing is a rubbish site.
Dont use this again.
I recommend deleting this question and ask again after finding a better site to learn from.
ASKER CERTIFIED SOLUTION
Avatar of mccarl
mccarl
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

ASKER

in this example what it is?

In the above minimal example, line 8 (the line that just says "continue") is an example of conditional code. That line IS executed if x == 30 but it is NOT executed otherwise.

i see your point.
usually diamond check box in diagram drawn at top. here drawn at bottom to add confusion. i got it now