1
import java.util.Scanner;

public class ComparingNumbers {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int FirstNum = Integer.valueOf(scanner.nextLine());
        int SecondNum = Integer.valueOf(scanner.nextLine());

        if (FirstNum > SecondNum) {

            System.out.println(FirstNum + " is greater than " + SecondNum + ".");
        } else if (FirstNum < SecondNum) {
            System.out.println(FirstNum + " is smaller than " + SecondNum + ".");
        } else {
            System.out.println(FirstNum + " is equal to " + SecondNum + ".");
        }
    }
}

Line 9: Name 'FirstNum' must match pattern '^[a-z][a-zA-Z0-9]$'.
Line 10: Name 'SecondNum' must match pattern '^[a-z][a-zA-Z0-9]
$'.

What is the issue with my variable names?. I am a beginner so a simple answer will be greatly appreciated.

0

1 Answer 1

1

Java variable names should be camelCase. Variable names should be firstNum and secondNum.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.