bom dia, ta acontecendo um error estranho no meu codigo.
package br.com.alura.java.io.teste;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
public class teste {
public static void main(String[] args) throws IOException {
System.out.println();
InputStream fis = new System.in; //<---aqui
InputStreamReader isr = new InputStreamReader(fis);
BufferedReader br = new BufferedReader(isr);
OutputStream fos = new System.out; //<----aqui tbm;
OutputStreamWriter osw = new OutputStreamWriter(fos);
BufferedWriter bw = new BufferedWriter(osw);
String linha = br.readLine();
while (linha != null && !linha.isEmpty()) {
bw.write(linha);
bw.newLine();
bw.flush();
linha = br.readLine();
}
br.close();
bw.close();
}
}
o seguinte erro aparece:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
System.in cannot be resolved to a type
System.out cannot be resolved to a type
at br.com.alura.java.io.teste.teste.main(teste.java:15)