1/16
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
equal to
==
not equal to
!=
greater than
>
greater than or equal to
>=
less than
<
less than or equal to
<=
if statement variable a equals b
if(a==b)
{
}
if statement string answer equals address variable ignoring cap letters
if(answer.equalsIgnoreCase(address))
{
}
if statement string answer equals Ottawa ignoring caps
if(answer.equalsIgnoreCase(“Ottawa”)
{
}
convert String holiday = “Thanksgiving” to char letter 4
letter = holiday.charAt(4);
convert String holiday = “Thanksgiving" to length
int length = holiday.length();
or
||
and
&&
not
!
switch limits
ONLY FOR ints, chars, String; no logical operations
switch example country not variable
switch (country)
{
case (“Canada”):
case (“canada”):
{
System.out.println(“You chose Canada”);
break;
}
default:
{
System.out.println(“invalid country”);
break;
}
}
initializing char variable letter
letter = scanS.nextLine( ).charAt(0);