wadie
wadie

Reputation: 508

"Variable out of type PrintStream" error occured

I'm starting to learn Java and have encountered some issues.

public class Hello {
    public static void main(String[] args) {
        System.out.printIn("Hello");
        }
    }

Using Notepad++. have the SDK. to compile I used javac Hello.java, but it resulted with the following error:

Symbol: method PrintIn

Location: Variable out of type PrintStream

Upvotes: 8

Views: 38225

Answers (7)

Sandeep Nautiyal
Sandeep Nautiyal

Reputation: 111

Its not printIn() it is println()

Upvotes: 0

Xavier Guzman
Xavier Guzman

Reputation: 460

If that is your actual code the problem is you have a typo in your code.

Method System.out.printin(); does not exist

System.out.println("Hello");

You got confused between a lower "l" and a capital "i"

Upvotes: 2

user177800
user177800

Reputation:

try System.out.println("Hello"); instead.

Notice the lower case L instead of the upper case I you have in your example.

println is short for print line, why they didn't just use printLine instead is crazy. Its not like they avoided vowels in many of the other API methods.

Pick a good IDE with code completion and you won't have these problems going forward.

Upvotes: 5

fireshadow52
fireshadow52

Reputation: 6516

Your error is just a typo, happens even to the best of us:

Use a lowercase 'L' instead of an uppercase 'I'; in some IDE's the two look very analogous!

System.out.println("Hello");

Remember: println() stands for "print line".

P.S. I would recommend a better IDE software such as NetBeans or Eclipse. Both of these catch syntax errors so you don't have to worry.

Upvotes: 17

ccheneson
ccheneson

Reputation: 49410

It is not

System.out.printIn 

but

System.out.println (it's a l)

Upvotes: 6

Joachim Isaksson
Joachim Isaksson

Reputation: 181077

It's println, not printIn (lower case "ln" as in short for line)

Upvotes: 3

cheeken
cheeken

Reputation: 34685

You want println, not printIn.

Upvotes: 7

Related Questions