answersLogoWhite

0

Very simple example of an If statement checking a password just so you can see the syntax..



if (Password.equals("Password123"))
{
System.out.println("Welcome");
}
else
{
System.out.println("Incorrect Password");
}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

What does do in java?

You never write "do" seperately in Java. The only situation I can think of when you have to write "do" is in the "do while" statement. This is the syntax: do { statement(s) } while (expression);


What does INS do?

You never write "do" seperately in Java. The only situation I can think of when you have to write "do" is in the "do while" statement. This is the syntax: do { statement(s) } while (expression);


Write Four different java statement that each add to integer variable x?

++x; x++; x += 1; x = x + 1;


What advantage does Java's break statement have over C's break statement?

They do the same thing, but only the former can be used in a Java program.


How to write an if then statement in java?

<if_stmt> --> if(<expr>) {<stmt>} else [<stmt>] for example if(x>y){ max=x; }else [optionally] { max=y; }


What are semicolons used in java?

to end a statement


What is a simple java code and explain what the code does?

int a;This simple Java statement declares an integer.


What is case in java?

Case is used to label each branch in the switch statement in Java Program


Can we add website link when we write java program?

yes ,i can add the website link in java program when we write.


What is the use of switch statement in java?

In java, a switch statement is used to simplify a long list of 'if' statements. A switch statement takes the form of:switch (variableName){case condition1; command1;case condition2; command2;...}


How do you write a java program for finding multiligual languages?

You can use Java's built-in functions to write a code that will find multilingual languages.


How can you use the "break" statement in Java to prematurely exit a "for" loop?

In Java, you can use the "break" statement within a "for" loop to exit the loop prematurely. When the "break" statement is encountered, the loop will immediately stop executing and the program will continue with the code after the loop.