Hi All,
Can anyone of you guide me that how to use IF condition in Java?
Thanks,
Vani.
How to use if condition in Java
Page 1 of 14 Replies - 22607 Views - Last Post: 24 March 2009 - 04:28 AM
Replies To: How to use if condition in Java
#2
Re: How to use if condition in Java
Posted 23 March 2009 - 12:25 PM
I would love to sit here and tell you all about it, but someone else took the time to educate you already 
mostyfriedman Tutorial
Happy Coding!!
mostyfriedman Tutorial
Happy Coding!!
#3
Re: How to use if condition in Java
Posted 23 March 2009 - 12:30 PM
#4
Re: How to use if condition in Java
Posted 24 March 2009 - 04:05 AM
Example of if
if(condition)
statement;
if(condition)
{statement;}else
{statement 2;}
Demostaration of if
if(condition)
statement;
if(condition)
{statement;}else
{statement 2;}
Demostaration of if
class ifdemo{
public static void main(int n){
if(n%2==0)
System.out.println("The no is even!!");
else
System.out.println("The no is even!!");}}
class maxmin{
public static void main(int a,int b){
if(a>b)
System.out.println("a`s value is minimum b`s value is maximum");
else
System.out.println("b`s value is minimum a`s value is maximum");
}}
#5
Re: How to use if condition in Java
Posted 24 March 2009 - 04:28 AM
priya_lorha, on 24 Mar, 2009 - 03:05 AM, said:
Example of if
if(condition)
statement;
if(condition)
{statement;}else
{statement 2;}
Demostaration of if
if(condition)
statement;
if(condition)
{statement;}else
{statement 2;}
Demostaration of if
class ifdemo{
public static void main(int n){
if(n%2==0)
System.out.println("The no is even!!");
else
System.out.println("The no is odd!!");}} //CORRECTION
class maxmin{
public static void main(int a,int b){
if(a>b)
System.out.println("a`s value is minimum b`s value is maximum");
else
System.out.println("b`s value is minimum a`s value is maximum");
}}
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|