I can't run a Java program

java

Solution

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.

Problem

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 a whole list of text which means its supposed to work, right? This is my java code: ``` class apples{ public static void main(String args[]) { System.out.printIn("hello youtube"); } } ``` I saved it in a folder called 'test' in my c drive. This is what I typed in cmd: ``` cd \ dir ``` now it lists everything in my c drive and one of them is test ``` cd test dir ``` Now it lists everything in test and one of them is '`youtube.java`'(the file I named), so I type ``` javac youtube.java ``` This doesn't work This is what it gives me: youtube.java:3: error: cannot find symbol System.out.printIn("hello youtube"); symbol: method printIn(string) location: variable out of type PrintStream 1 error Can someone help me out with this?

Original source