Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

how to use string variables with an if statement in java

String a = "Hello"

if (a.equals("Hello") {
	System.out.println("Variable A is Hello");
} else {
	System.out.println("Variable A is not hello :(");
}
Comment

if statement with string java

if (var.equals("text"))
Comment

Java if with String

class Main {
  public static void main(String[] args) {
    // create a string variable
    String language = "Java";

    // if statement
    if (language == "Java") {
      System.out.println("Best Programming Language");
    }
  }
}
Comment

PREVIOUS NEXT
Code Example
Java :: arraylist add method 
Java :: java find duplicates in array 
Java :: += in java 
Java :: get last day of month java 
Java :: matrix rotation in java 
Java :: java abstract class 
Java :: arduino convert byte array to string 
Java :: adding an element to the end of a linked list java 
Java :: java program to print vowels in a string 
Java :: how to set default color in android studio 
Java :: how to create a boolean list in java 
Java :: java hello world program 
Java :: loop through array in java 
Java :: Vowel or consonant in java using if else 
Java :: polimorfismo java ejemplo 
Java :: save text in edditext java 
Java :: partioning operation Java 
Sql :: FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future. Set it to True or False to suppress this warning. 
Sql :: mysql create user with remote access 
Sql :: mysql now format 
Sql :: . ERROR! The server quit without updating PID file (/usr/local/var/mysql/MacBook-Pro-de-Quentin.local.pid). 
Sql :: put line oracle 
Sql :: mysql dump all databases 
Sql :: how to restart mysql in linux 
Sql :: mysql drop database if exists 
Sql :: c# datetime to sql server datetime 
Sql :: how to see which columns are indexxed mysql 
Sql :: VERIFY INDEXES IN SQL ORACLE 
Sql :: mysql last day of next month 
Sql :: restart mysql server ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =