林要去跟與我的車跑的編譯器的幫助,我chaned一些東西,我有1個錯誤試圖實現一個類
public class AutomobileDescription
{
/**
Constructor to display the make, model and price the new automobile I wish to purchase
*/
public AutomobileDescription(String carMake, String carModel, carPrice)
{
make = m;
model = mo;
price = p;
}
public String m =("Toyota");
public String mo =("Camry");
public String p =("22055");
public String getAutomobileinfo()
{
return m + mo + p;
Automobile myAutomobile = new Automobile(Toyota, Camry, 22055);
System.out.println("The Make, Model and Price of the car is: m + mo + p ");
}
}
---- jGRASP高管:javac的-g AutomobileDescription.java
AutomobileDescription.java:7:錯誤:預期 公共AutomobileDescription(字符串carMake,字符串carModel,carPrice) ^ 1錯誤
---- jGRASP wedge2:退出代碼FO r進程爲1. ---- jGRASP:操作完成。
你有問題嗎? – SLaks
方法應該有名稱,只能有字母,數字或下劃線。 – SLaks
此外,您必須提供執行'getMake','getModel'和'getPrice'。 – Vulcan