-2
public class 12.java {
public static void main(String[] args) {

    
    Scanner keyboard = new Scanner(System.in);

    System.out.print("Enter the name of your favorite city: ");

    String city = keyboard.nextLine();

        keyboard.close();

      System.out.println("Number of characters: " + city.length());

    
    System.out.println(city.toUpperCase());

        System.out.println(city.toLowerCase());

    System.out.println(city.charAt(0));
    }
}
Bohemian
  • 412,405
  • 93
  • 575
  • 722

1 Answers1

2

“12.java” is not a valid java class name, which must start with a letter followed by either letters or numbers (underscores are considered to be letters).

Change it to something that starts with a letter (normally a capital letter) and does not have a dot, eg:

public class Twelve
Bohemian
  • 412,405
  • 93
  • 575
  • 722