class Base
{
int x;
int y;
void show()
{
System.out.println(x);
System.out.println(y);
}
}
class Child extends Base
{
void get(int x,int y)
{
this.x=x;
this.y=y;
}
public static void main(String[] args)
{
Child c1=new Child();
c1.get(10,20);
c1.show();
}
}
請糾正這個問題..我不明白類基本沒有發現主要方法
顯然,你嘗試運行沒有主要方法的類「Base」。問題是什麼? – Juvanis
嘗試運行'java Child'! – NINCOMPOOP
我在哪裏寫主要方法...請糾正我的問題..我想任何關閉brasec創建錯誤 – user2601676