
import java .io.*; public class Test{ public static void main(String[] args) throws IOException{ BufferedReader steffi=new BufferedReader(new InputStreamReader(System.in)); String name; String answer1; int ctr1=0;
System.out.println("Enter your name:");
name=steffi.readLine();
System.out.println("1.What is the name of the developer of java?");
System.out.println("\tA. Steve Jobs");
System.out.println("\tB. James Gosling");
System.out.println("\tC. Bill Gates");
System.out.println("\tD. None of these");
System.out.print("Enter your answer:");
if(answer1.equalsIgnoreCase("B"))
{
ctr1++;
}
}
}

We have modified your code. Here it is:
import java .io.*;
public class Test{
public static void main(String[] args) throws IOException{
BufferedReader steffi=new BufferedReader(new InputStreamReader(System.in));
String name;
String answer1="";
int ctr1=0;
System.out.println("Enter your name:");
name=steffi.readLine();
System.out.println("1.What is the name of the developer of java?");
System.out.println("\tA. Steve Jobs");
System.out.println("\tB. James Gosling");
System.out.println("\tC. Bill Gates");
System.out.println("\tD. None of these");
System.out.print("Enter your answer:");
answer1=steffi.readLine();
if(answer1.equalsIgnoreCase("B"))
{
ctr1++;
}
}
}
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.