user10568310
user10568310

Reputation: 29

PrintStream cannot be resolved to a type. Why?

PrintStream ps1, ps2;

My compiler tells me that

PrintStream cannot be resolved to a type

Why? This is my professor's code. Why doesn't it work? I thought you could use PrintStream as a type so that you can also write ps1=System.out for example.

Upvotes: 0

Views: 1856

Answers (1)

suvojit_007
suvojit_007

Reputation: 1728

My compiler tells me that "PrintStream cannot be resolved to a type". Why?

you need to import PrintStream class. Just add import java.io.PrintStream; at the beginning of your script.

Upvotes: 1

Related Questions