當前位置:編程學習大全網 - 編程軟體 - 求java基礎編程運行結果截圖

求java基礎編程運行結果截圖

class?Simple{

private?int?IntValue;

private?double?DoubleValue;

private?String?StrValue;

public?int?getIntValue()?{

return?IntValue;

}

public?void?setIntValue(int?intValue)?{

IntValue?=?intValue;

}

public?double?getDoubleValue()?{

return?DoubleValue;

}

public?void?setDoubleValue(double?doubleValue)?{

DoubleValue?=?doubleValue;

}

public?String?getStrValue()?{

return?StrValue;

}

public?void?setStrValue(String?strValue)?{

StrValue?=?strValue;

}

}

public?class?TestSimple?{//測試類的

public?static?void?main(String[]?args)?{

//創建Simple類的對象aSimple

Simple?aSimple?=?new?Simple();

//set方法分別對對象的各個屬性設置具體的值

aSimple.setIntValue(5);

aSimple.setDoubleValue(123.45D);

aSimple.setStrValue("string?value?for?simple");

//get方法將aSimple的具體的值輸出在屏幕上

System.out.println("運行的結果如下:");

System.out.println("int?value?for?simple?is:?"?+?aSimple.getIntValue());

System.out.println("double?value?for?simple?is:?"?+?aSimple.getDoubleValue());

System.out.println("String?value?for?simple?is:?"?+?aSimple.getStrValue());

}

}

不知道是不是這樣的?

  • 上一篇:瑞士蘇拉2S-55刺繡機
  • 下一篇:孫策孫堅華佗強不強
  • copyright 2024編程學習大全網