Java tutorial for beginners playlist
• Java tutorial for beginners
Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.
/ @aarvikitchen5572
Java if else statement
In this video we will discuss "if else" control flow statement in Java with examples.
if else syntax
if (condition) {
statement1a; // if condition is evaluated true
statement2a;
:
}
else {
statement1b; // if condition is evaluated false
statement2b;
:
}
Please note that opening and closing braces are optional when there is single statement. Else is also optional.
Nested if syntax
if (expression-1)
if (expression-2)
statement-1 ;
else
statement-2 ;
else
if (expression-3)
statement-3 ;
else
statement-4;
Nested if example
if (score ]200) {
if (score [400) {
if (score ]300) {
System.out.println(1);
}
else {
System.out.println(2);
}
else {
System.out.println(3);
}
}
Auf dieser Seite können Sie das Online-Video Java if else statement mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer kudvenkat 06 April 2017 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 16,673 Mal angesehen und es wurde von 86 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!