Let us start a thread on ' if ' statement in Java.
5 replies to this topic
#1
Posted 05 June 2011 - 05:43 AM
|
|
|
#2
Posted 06 June 2011 - 04:11 AM
Why would we want to start that thread? There isn't much to discuss.
#3
Posted 07 June 2011 - 07:55 AM
For a beginer we can start it. [excuse me if i do anything wrong.]
1. if(condition)
<statement>;
2. if(condition)
<statement>;
if(condition)
<statement>;
3. if(condition)
<statement1>;
<statement2>;
and we can progress step by step.
Would it be helpful for a beginer? Please reply.
1. if(condition)
<statement>;
2. if(condition)
<statement>;
if(condition)
<statement>;
3. if(condition)
<statement1>;
<statement2>;
and we can progress step by step.
Would it be helpful for a beginer? Please reply.
Sinipull said:
Why would we want to start that thread? There isn't much to discuss.
#4
Posted 07 June 2011 - 09:42 AM
You are doing it wrong, you can't add two statements after the if-clause without using curly brackets
if(condition){
statement1;
statement2;
} else {
statement3;
}
this would be the right syntax.
#5
Posted 12 June 2011 - 01:38 AM
Please mention sl number. Are you talking about number 3?
Sinipull said:
You are doing it wrong, you can't add two statements after the if-clause without using curly brackets
if(condition){
statement1;
statement2;
} else {
statement3;
}
this would be the right syntax.
#6
Posted 12 June 2011 - 04:22 AM
Yes, they have mentioned two statements after the if clause without curly bracket, so you can assume it is number three of which does not work.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









