Delete comment from: Java67
hello i have illegal start of expression please can you help how to fix it.
double total=;
^
1 error
import java.io.*;
public class Bufferedreader{
public static void main(String[] args){
BufferedReader dataIn = new BufferedReader( new
InputStreamReader(System.in) );
String yards = "25.5";
System.out.print("Enter number of yards:");
try{
yards = dataIn.readLine();
}catch( IOException e ){
System.out.println("Error!");
}
String feet = "23";
System.out.print("Enter number of feet:");
try{
feet = dataIn.readLine();
}catch( IOException e ){
System.out.println("Error!");
}
String inches = "12.7";
System.out.print("Enter number of inches:");
try{
inches = dataIn.readLine();
}catch( IOException e ){
System.out.println("Error!");
}
double total=;
System.out.print("");
try{
total = dataIn.readLine();
}catch( IOException e ){
System.out.println("Error!");
}
System.out.println("25.5 yards = " + yards);
System.out.println("23 feet = " + feet);
System.out.println("12.7inches = " + inches);
Total_centimeters = ((yards *3 *12 *2.54) + (feet * 12 * 2.54) + inches * 2.54);
System.out.println("The total centimeters is equal to " + total);
}
}
Oct 8, 2020, 12:59:11 AM
Posted to How to fix "illegal start of expression" error in Java? Example