我知道這個問題在這裏被問到,但它涉及到不同的東西。這是我的課程,我必須創建自己的課程。另外,當我嘗試使用system.out.printf()函數時,它不工作怎麼回事?謝謝你,從一個非常失敗的初學程序員。 :無法解析java.lang.Charsequence類型。它是從所需的類文件間接引用的
public class IDInfo {
public static void main(String[] args){
}
private double name;
private double studentID;
private double Major;
private double CreditsNeeded;
private double CreditsTaken;
String getName = "Alex Wilson";
String getID = "916183391";
String getMajor1 = "Biochemistry";
String getCreditsNeeded = "128";
String getCreditsTaken = "14";
public void setname (double name )
{
name = name;
}
public void setstudentID (double ID)
{
studentID = ID;
}
public void setMajor (double Major)
{
Major=Major;
}
public void setCreditsNeeded (double CreditsNeeded)
{
CreditsNeeded=CreditsNeeded;
}
public void setCreditsTaken (double CreditsTaken)
{
CreditsTaken=CreditsTaken;
}
public double getName()
{
return name;
}
public double getID()
{
return studentID;
}
public double getMajor()
{
return Major;
}
public double getCreditsNeeded()
{
return CreditsNeeded;
}
public double getCreditsTaken()
{
return CreditsTaken;
}
public double getCreditsRemaining()
{
return CreditsNeeded - CreditsTaken;
}
{
}}
那麼它沒有幫助,你沒有顯示代碼顯然失敗 - 但你已經展示了很多不相關的代碼。請顯示一個簡短但完整的程序(並且格式正確),以顯示問題 - 理想情況下,同時查找Java命名約定。 –