The try/catch structures prevent you from seeing any problem in code.
The only ways to know what is doing your code is by removing the try/catch or by using a debugger.
-----
Learn to indent properly your code, it show its structure and it helps reading and understanding. It also helps spotting structures mistakes.
public class BufferedReaderFromUserAnd
{
private static final String FILENAME = "F:/Android.txt";
public static void main(String args[]) throws IOException
{
BufferedWriter bw = null;
FileWriter fw = null;
try
{
fw = new FileWriter(FILENAME);
bw = new BufferedWriter(fw);
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Word: ");
String Word = reader.readLine();
System.out.print("Y: ");
String y = reader.readLine();
System.out.print("The correct answer is: " + y);
String a = "not" ;
String b = "not" ;
String c = "not" ;
String d = "not" ;
if (y==a)
{
System.out.print("A: ");
a = reader.readLine();
a ="";
}
String n = reader.readLine();
bw.write("<input type='radio' name='rbnNumber' value='You selected (a) " + Word + " which is "+ a +" the correct answer' />(a) " + Word + "<br/>");
}
catch (IOException e) {
e.printStackTrace();
}
finally
{
try {
if (bw != null)
bw.close();
if (fw != null)
fw.close();
}
catch (IOException ex) {
ex.printStackTrace();
}
}
}
}
Professional programmer's editors have this feature and others ones such as parenthesis matching and syntax highlighting.
Notepad++ Home[
^]
ultraedit[
^]