課程
/后端開發(fā)
/Java
/Java入門第一季(IDEA工具)升級版
System.out.println("數(shù)組中第4個科目為:" +subjects[3] ); ? 有問題嗎?
2016-11-08
源自:Java入門第一季(IDEA工具)升級版 6-3
正在回答
imt是什么鬼?字符串型用String定義
String[] subjects =new imt[5] //imt錯誤你這個定義錯誤,改為String
沒問題,但你的代碼有問題
public class HelloWorld {
? ? public static void main(String[] args) {
? ? ? ??
// 定義一個長度為5的字符串數(shù)組,保存考試科目信息
String[] subjects =new String[5] ? ? ? ? ? ? ? ? ? ?;
// 分別為數(shù)組中的元素賦值
subjects[0] = "Oracle";
subjects[1] = "PHP";
subjects[2] = "Linux";
subjects[3] = "Java";
subjects[4] = "HTML";
System.out.println("數(shù)組中第4個科目為:" +subjects[3] );
}
舉報
0基礎萌新入門第一課,從Java環(huán)境搭建、工具使用、基礎語法開始
1 回答有問題嗎?
2 回答例題有問題嗎?
1 回答這個有問題嗎?
1 回答方法有問題嗎?
1 回答這段有問題嗎
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學習伙伴
掃描二維碼關注慕課網(wǎng)微信公眾號
2017-01-04
imt是什么鬼?字符串型用String定義
2016-11-11
String[] subjects =new imt[5] //imt錯誤
你這個定義錯誤,改為String
2016-11-08
沒問題,但你的代碼有問題
public class HelloWorld {
? ? public static void main(String[] args) {
? ? ? ??
// 定義一個長度為5的字符串數(shù)組,保存考試科目信息
String[] subjects =new String[5] ? ? ? ? ? ? ? ? ? ?;
? ? ? ??
// 分別為數(shù)組中的元素賦值
subjects[0] = "Oracle";
subjects[1] = "PHP";
subjects[2] = "Linux";
subjects[3] = "Java";
subjects[4] = "HTML";
? ? ? ??
System.out.println("數(shù)組中第4個科目為:" +subjects[3] );
}
}