[code]/*
-
To change this template, choose Tools | Templates
-
and open the template in the editor.
/
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
/* -
@author zafar
*/
public class GetInputFromKeyboard {/**
-
@param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
BufferedReader dataIn = new BufferedReader(new inputStreamReader(System.in));
String name = “”;
System.out.println(“Please enter your Name:”);
try {
name = dataIn.readLine();
} catch (IOException e) {
System.out.println(“Error!”);
}
System.out.println("Hello " + name + “!”);
}
private static class inputStreamReader {
public inputStreamReader(InputStream in) { }
}
-
@param args the command line arguments
}
[/code]
Tentei compilar o código acima no netbeans mas ocorreu o erro abaixo. Não sei o que é.
cannot find symbol
symbol : constructor BufferedReader(GetInputFromKeyboard.inputStreamReader)
location: class java.io.BufferedReader
BufferedReader dataIn = new BufferedReader(new inputStreamReader(System.in));