Recap - True or False
Part of the Fundamentals section of Coddy's Java journey — lesson 37 of 73.
Challenge
BeginnerWrite a program that gets a String input from the user.
The program will output "T" if the input equals "1" and "F" otherwise.
Hint: In Java, use .equals() to compare Strings instead of ==, as == checks reference equality and may not work correctly for String comparison.
Try it yourself
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// Write your code below
}
}All lessons in Fundamentals
4Operators Part 1
Arithmetic OperatorsModulo OperatorIncrement/DecrementPost Increment/DecrementArithmetic ShortcutsComparison OperatorsString Comparison5Operators Part 2
Logical Operators Part 1Logical Operators Part 2Recap - Simple LogicLogical Operators Part 3Logical Operators Part 43Variables Part 2
ConstantsNaming ConventionsRecap - Initialize VariablesType Casting Part 1Type Casting Part 26Decision Making
If StatementIf - ElseSwitch StatementTernary OperatorRecap - If ElseNested If - Else