search file within a directory
hi there... i need to search for a file in a directory. but when i execute it, instead of just typing news.txt i need to type C:/news.txt why is that so when i already concat it.. here is the code and thank you in advance.
public static void main(String[] args) throws IOException{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter file to search : ");
File filename = new File(in.readLine());
if (filename.exists()){
String b = ("C:/").concat(filename.getName());
System.out.println("File name : " + b + " " +"found");
}
else{
Sender sm = new Sender();
sm.doSend();
}
}

