UrbanPro
true

Learn Java Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

CONDITIONAL STATEMENT - IF ELSE

Khushi A.
23/05/2019 0 0

1. IF condition

only if is true conditon is required.

if(condition)
{
//statements
}


2. IF-ELSE condition

1. to check whether the condition will be true or false.
syntax of if-else
2. only 1 condition
if(condition)
{
//statements
}
else
{
//statements
}


3. if - else if

we can add "else if" to execute multiple conditions

syntax
if(condition)
{
//statements
}
else if(condition)
{
//statements
}
else if(condition)
{
//statement
}
else
{
//statement
}


4. Nested if-else condition
if(condition)
{
//statements
if(condition)
{
//statement
}
else
{
//statement
}
//statement
}
else
{
//statements
if(condition)
{
// statement
}
else if(condition)
{
//statement
}
else
{
//statement
}
}

0 Dislike
Follow 2

Please Enter a comment

Submit

Other Lessons for You

Priority in TestNG
public class Priority { @Test (priority=1)public void login() {System.out.println("login");} @Testpublic void email1() {System.out.println("email1");} @Test (priority=-2)public void email2() {System.out.println("email2");} //I...
S

Sarthak C.

0 0
0

Java Interview Questions & Answers
Java Interview Questions have been designed especially to get you acquainted with the nature of questions you may encounter during your interview for the subject of Java Programming Language. As per my...

Interview Tip : Q1) Why Strings are immutable in java ? What happen if it was mutable in java?
As we all know that Strings in java are immutabe in nature, now the question comes why the creator made it immutable in nature, although this field used maximum in any java program. The answer to this...

Java: A Quick Overview
Not purely Object Oriented: It doesn't support multiple inheritence, it supports primitive data types and static members. Doesn’t support multiple inheritance: Reason is diamond problem i.e.,...

History Of Java
Java history is interesting to know. The history of java starts from Green Team. Java team members (also known as Green Team), initiated a revolutionary task to develop a language for digital devices such...
V
X

Looking for Java Training Classes?

The best tutors for Java Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Java Training with the Best Tutors

The best Tutors for Java Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more