Java if else statement

Publicado em: 06 Abril 2017
no canal de: kudvenkat
16,673
86

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);
}
}


Nesta página do site você pode assistir ao vídeo on-line Java if else statement duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário kudvenkat 06 Abril 2017, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 16,673 vezes e gostou 86 espectadores. Boa visualização!