0
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.

Hülya
  • 3,353
  • 2
  • 12
  • 19

1 Answers1

1

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.

suvojit_007
  • 1,690
  • 2
  • 17
  • 23