answersLogoWhite

0

The if else block can be used like below:

public static void main(String[] args){

int age = 15;

if(age > 18) {

System.out.println("You are an Adult");

} else {

System.out.println("You are a Minor");

}

}

The if block has code that needs to be executed in case the condition is a success and the else block is for cases when the condition fails.

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

What is the latest IDE of java?

Eclipse


What kind of project is Eclipse BIRT?

The Eclipse BIRT project is an open source Eclipse-based reporting system. The system integrates with Java/Java EE applications to produce compelling reports.


Where can one download the Eclipse Java program?

One can easily download Eclipse Java for free on Eclipse's website. Popular download sites such as Softpedia, Sourceforge, and CNET also offer this download.


How can you become a good java programmer. Using Eclipse or even BlueJ?

It is suggested to take college courses in Java to become a good Java programmer using the programs Eclipse or BlueJ. These courses can be found in-class, or online.


What Do you Open your java File With?

.java files can be opened using an IDE (like Eclipse or NetBeans) or with notepad.exe.


What is Java editor?

A Java editor is nothing but a tool that can be used to edit java source files. Ex: Textpad, Notepad, Eclipse etc...


Is it possible to have file name as java eg javajava?

Yes you can name a file (class if you use eclipse) java or even have java in the name.


How can TFS be accessed by Java developers?

Through all variants of Eclipse


Where can one download a java runtime environment?

The java runtime environment can be downloaded from several websites. Among them are Oracle, Java, CNET, Softsonic, Eclipse, AfterDawn, Soft32, and OldApps.


What is java ide?

Java Integrated Development Environment (IDE) provides an environment to Edit, compile and debug and generate java codeThere are several java IDE like Eclipse, WSAD, BlueJ, JCreator etc


Are tools like Eclipse different languages from Java?

Eclipse is not a language. It is an Integrated Development Environment (IDE). These are tools designed to allow you to easily and quickly write, run, test, and debug code for various programming languages.There are versions of the Eclipse IDE for: Java, C/C++, and PHP.


What are Java beans?

In eclipse you can create java bean by generating getters and setters. Getters and setters are generated as ' alt + shift + s + r'.