5 回答
賣草莓的吊腳娃
TA貢獻2條經驗 獲得超0個贊
import?java.util.Arrays;
public?class?HelloWorld?{
?//定義了一個方法名為?print?的方法,實現輸出信息功能
????public?static?void?main(String[]?args)?{
???? //?定義一個整型數組,保存成績信息
???? int[]?scores?=?{?89,?72,?64,?58,?93?};
???? ????????
???? //?對Arrays類對數組進行排序
???? Arrays.sort(scores);
???? ????????
???? //?使用foreach遍歷輸出數組中的元素
???? for?(int?score:scores)?{
???? System.out.println(score);
???? }
????}
}eclipse是最新版的,但是JRE的環境沒有設置對,設置方法如下:eclipse中:右鍵你的項目--Build?Path--Add?Libraries--JRE?System?Library(單機Next)--Execution?environment(選擇)--JavaSE?1.5
添加回答
舉報
0/150
提交
取消
