Cannot find symbol error


#1

I ran into this same problem a few months ago when I was first starting to learn programming - I downloaded a jdk for Mac OSX but when I tried the classic first "Hello world" program, my macbook wouldn't compile the code correctly. It would point to the second period in System.out.printIn();, saying:

error: cannot find symbol
symbol: method printIn()
location: variable out of type PrintStream

This is exactly the error I get when I try to type exactly what is shown, in this instance:

public class DataTypes {
    public class void main(String[] args) {

        System.out.printIn(765856);

    }
}

The weird thing is that the code works just fine so long as I don't type it in myself. I worry that the codecademy page depends on my java working properly, which it might not be. The one thing I haven't tried (I'm reluctant because it's an old laptop) is upgrading to a different OS.

Any insight into this issue would be greatly appreciated as I literally can not learn java very well if my laptop refuses to do it right.


#3

Before you recycle your laptop, take notice that the name of the method is
System.out.println() , and not
System.out.printIn()


#5

Holy ■■■■.

Oh my god.

I can't believe I didn't see that typo. I tried starting to learn java months ago, I tried writing the same stupid Hello World program like 20 times, I used terminal and jedit and went online... I can't believe that's all it was.

I started learning javascript instead because I thought my laptop just wouldn't run java properly. Wow.

Thank you so much. You have no idea how long I couldn't understand why the ■■■■ the stupid code wouldn't compile. I can't believe how blinded I was, thinking it MUST be printIn because that follows naming conventions and makes sense and so on.

So, what does ln stand for? Is it "line"? Does it basically then say "print line"?

I'm so excited that I can finally start learning java for real now.


#6

Hahaha, I was kind of wondering what your reaction would be. And yes, I would think so at least. It prints the argument + newline


#7

Yeah... I just can't believe I didn't notice it before. I even remember wondering about the font they were using in this one book I borrowed and whether it would become problematic for certain letters... Turns out it was.

Anyway, yeah that makes sense, kind of like br in html if I remember correctly.