I can't run a Java program

前端 未结 2 1377
野性不改
野性不改 2021-01-24 07:02

I was starting to learn Java. I followed the tutorial on how to install it. I also checked by typing \"javac\"(without the quotation marks) in cmd if it works. And yes it gives

2条回答
  •  臣服心动
    2021-01-24 07:38

    You have a typo in your call. Change

    System.out.printIn("hello youtube");  // capital 'I'
    

    to

    System.out.println("hello youtube");  // lowercase 'l'
    

    And as has been mentioned already, in Java, the public class in a file must match the filename.

提交回复
热议问题