can u help us to solve this problem ')' expected in line 4 this is my error in this program...pls help me....

public static void removeFile(){
    	String ans=" ";
    	try{
    		System.out.print("are you sure you want to delete this file ["my file+"]y=yes/n=no");
    		ans=stdin.readline().Trim();
    		if(ans.equals("y")){
    			if (myfile.exists()){
    			}
    				myfile.delete();
    			
    		}	else
    			System.out.println("Successfully deleted");
    	}
    	catch(IOException e){
    		e.printStackTrace();
}
    }
}
System.out.print("are you sure you want to delete this file ["my file+"]y=yes/n=no");

my file or myfile Take a closer look at that line. Also, what about the "connection" between the first quoted String and that variable? Isn't something missing there, as well? Once again, take a closer look at that line.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.