當前位置:首頁 » 編程語言 » java的調試

java的調試

發布時間: 2023-06-28 01:59:22

『壹』 java調試

第一問:

publicclassPoint
{
intx,y;
floata,b;
staticintz;

voidsetValue(intm,intn)
{
this.x=m;
this.y=n;
}

voidsetValue(floata,floatb)
{
this.a=a;
this.b=b;
}

staticvoidoutput()
{
Pointpoint=newPoint();
System.out.println("x="+point.x+",y="+point.y+",a="+point.a+",b="+point.b+",z="+Point.z);
}
}

第二問:

publicPoint()
{
super();
}

publicPoint(intz1,intz2,floatz3,floatz4)
{
this.x=z1;
this.y=z2;
this.a=z3;
this.b=z4;
}

第三問:

publicstaticvoidmain(String[]args)
{
Pointpt1=newPoint();
pt1.setValue(1,2);
pt1.setValue(3,4);

Pointpt2=newPoint();
pt2.setValue(5,6);
pt2.setValue(7,8);
}

第四問:

Pointpt3=newPoint(9,10,11,12);

第五問:

System.out.println("x="+pt1.x+",y="+pt1.y+",a="+pt1.a+",b="+pt1.b);
System.out.println("x="+pt2.x+",y="+pt2.y+",a="+pt2.a+",b="+pt2.b);

第六問:

System.out.println("pt1.z="+pt1.z);
System.out.println("pt2.z="+pt2.z);
System.out.println("pt3.z="+pt3.z);
pt1.output();
pt2.output();
pt3.output();
System.out.println("Point.z="+Point.z);
Point.output();
output();

希望可以幫到你。

熱點內容
java返回this 發布:2025-10-20 08:28:16 瀏覽:610
製作腳本網站 發布:2025-10-20 08:17:34 瀏覽:900
python中的init方法 發布:2025-10-20 08:17:33 瀏覽:594
圖案密碼什麼意思 發布:2025-10-20 08:16:56 瀏覽:778
怎麼清理微信視頻緩存 發布:2025-10-20 08:12:37 瀏覽:696
c語言編譯器怎麼看執行過程 發布:2025-10-20 08:00:32 瀏覽:1024
郵箱如何填寫發信伺服器 發布:2025-10-20 07:45:27 瀏覽:267
shell腳本入門案例 發布:2025-10-20 07:44:45 瀏覽:127
怎麼上傳照片瀏覽上傳 發布:2025-10-20 07:44:03 瀏覽:816
python股票數據獲取 發布:2025-10-20 07:39:44 瀏覽:729