
import java.io.*; class SString{ public static void main(String ar[]) throws IOException{ BufferedReader br = new Bufferedreader(new InputStreamReader(System.in)); System.out.println("Enter a char"); String name=br.readLine(); System.out.println("enter"+name);
} } if i compile this prog, i got error msg as D:\progs>javac SString.java SString.java:4: cannot find symbol symbol : class Bufferedreader location: class SString BufferedReader br = new Bufferedreader(new InputStreamReader(System.in)); ^ 1 error please tell me the resolution of this

Hi Friend,
If you want to enter string then try this:
import java.io.*;
class SString{
public static void main(String ar[]) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter string: ");
String name=br.readLine();
System.out.println("You have entered: "+name);
}
}
And if you want to enter character then try this:
class SString{
public static void main(String ar[]) throws Exception{
System.out.println("Enter a character: ");
int i=System.in.read();
System.out.println("You have entered: "+(char)i);
}
}
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.