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
The name of the class must match the filename.
You should use
public class Youtube{
in your code(as class names are capitalized) and call the file Youtube.java
.
Also you used In
instead of ln
.
Use:
System.out.println(
which means "print line to System.out".
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.