Вот код, который продолжает говорить, незаконное начало выражения:ошибка нелегальный начало выражения 11111
public static conversionRate= 4.546;
Вот полный код:
/**
* Write a description of class VolumeConversion here.
*
* @author (Aneeqa Rustam)
* @version (07/08/2014)
*/
public class VolumeConversion
{
// instance variables - replace the example below with your own
/**
* Constructor for objects of class VolumeConversion
*/
public VolumeConversion()
{
public static conversionRate= 4.546;
znaslcmlkmlskm(String[]args)
//Declare the variable and constants
double litres= 0;
double gallon= 14;
//Perform the conversion calculation
litres= gallon* conversionRate;
//This is the output result that is going to be shown to the user
System.out.println("The number of litres in "+gallons+ "gallons is" +litres);
}
}
Примечание: вам не нужно использовать 'd' для двойки, поскольку java интерпретирует числовые литералы с десятичными точками как двойные. – nmore
Да, правда;) Thx. – MrTux