answersLogoWhite

0

What is if-else in java?

User Avatar

Anonymous

14y ago
Updated: 8/19/2019

if-else is a logical construct in java that helps the code to take some actions based on the condition mentioned in the if block. The action that needs to be taken if the test fails goes into the else block.

Ex: lets say you want to check if a person is an adult

Public boolean checkAge(int age) {

if(age > 18) {

return true;

} else {

return false;

}

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

What Indonesian island is Jakarta on?

java


Does Visual Java plus plus and Java Builder is different from the Java language?

Yes!Visual Java plus plus and Java Builder is different from the Java language?


What are the different java technologies?

There are several types of Java technology. Some examples of Java software are Java ME, Java EE, Java SE, and Java Card. Java made the JAVA development kit for those that develop in Java. There is also Java Virtual machine and some class libraries. Java is also famous for its languages like Clojure, Beanshell, Groovy, Gosu, Rhino, Kotlin, JRuby, Scala, and Jython.


Small Java-based programs are called?

Java applets


Supermost package of java?

The supermost package of Java is the "java" package.


Who create Java and when?

Who create Java & when? Why he create java ? What are mane functions of it?


What do you call java and javascript?

Well you get java as java and javascript as iava.


Differences between Java Applet and Java Beans?

Java applet is a program used to run java applications while beans is a compiler used to design java programs (IDE, GUI) :-) GilbertC


What country is known for its java coffee in the Java sea?

Java coffee is made in Java, which is an island - part of INDONESIA


What is java 7?

Java 7 is the most current version of Java. Many movies and games use Java.


What is java's purpose on my PC?

Programs that are specifically designed with Java require a Java runtime to work on a computer. (In the case of Java, the runtime is called "Java Virtual Machine".) If you have any such program, you need to have Java.


Which one is more advanced core java or java?

The Core Java technologies and application programming interfaces (APIs) are the foundation of the Java Platform, Standard Edition (Java SE). They are used in all classes of Java programming, from desktop applications to Java EE applications. Well What exactly you mean by Java?