answersLogoWhite

0

How you use if condition in java?

User Avatar

Anonymous

13y ago
Updated: 8/20/2019

The if block is used in java to check a true or false condition. for ex:

if(age > 18) {

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

} else {

system.out.println("Sorry, you are still a kid");

}

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

How can I update an object in a list using Java Stream based on a specific condition?

To update an object in a list based on a specific condition using Java Stream, you can use the map function to update the object if the condition is met, and then collect the stream back into a list.


Can you use pointers in java?

Java does not support Pointers and hence you cannot use it in Java.


Why should throw keyword is used in java?

Use it when you are implementing something that says it throws a certain exception when a certain condition is met.


What technologies link to Java?

Java is exclusive to surfing the web. Some web sites use Java to embed videos, others use Java for advertisements.


Why do you use the loops in java?

You use loops in Java when you want a set of actions to be repeated until a particular condition is met or for a certain number of times.The different types of loops in Java are:For LoopsDo-While LoopsWhile Loops


What you use in case of pointer in java?

Java does not have pointers


Does Java Script use the same compiler as Java?

No


What is java 7?

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


Which is the best Book to understand JAVA in short?

You can use Head First Java or Java Complete Reference to learn Java.


Do you have to use java?

Not usually. There are numerous languages out there with similar functionality. The only time you must use Java is if your employer or client demands that a project be done in Java, or a particular platform requires the use of Java, such as Android OS.


How do you script a RuneScape bot?

RuneScape bots use Java. Use a Java Binary Code.


Why you not use clrscr in java?

Many reasons, one of them: there is no 'clrscr' in Java.