Monday, 9 April 2018

Conditional Operator

If statement   (if statement is check a true or false  condition).

  • There are several Conditional Operator
== (equal to)
!= (not equal to)
< (is greater than)
>(is less than)
<= (Greater than equal to)
>= (less than equal to)

Syntax:-
If(Condition)
{
Statement 1;
}
else
{
Statement 1;
}
}

Example:-
public class MyClass
{
public static void main(string[] arg)
{
int x=10;
if(x==10)
{
System.out println(“Yes x=10”);
}
else
{
System.out.println(“No x!=10”);
}
}
}

1 comment:

Popular Posts

Categories

Android (21) AngularJS (1) Books (3) C (75) C++ (81) Data Strucures (4) Engineering (13) FPL (17) HTML&CSS (38) IS (25) Java (85) PHP (20) Python (85) R (69) Selenium Webdriver (2) Software (13) SQL (27)