Java???鼰????????
???????????? ???????[ 2016/11/22 11:40:52 ] ????????Java ???? ???
??????????????????????????????????????????????????????????????á???java?У???????????????????????????java ?е??????? ????? ??????????????????????????鳤?????????????????? ????? ????á?
??????????????????
????· ?????????????????????????????????????????????
????String[] datas = new String[]{"java"??"C++"??"html"};
????· ????????:????????????????????????????
????String[] datas = new String[5];//????????5???????????????????null
???????????????
??????????????t???????????????????????鳤?????????
????2.???????????
??????????????????鰱???????
//1.?????????
String[] books = new String[]{
"???java ????"??
"??????javaee????????"??
"???ajax????"??
"???XNL????"
};
System.out.println("????????????????" + books.length);// 4
//2.??????????
String[] names = {
"?????"??
"????"??
"????"
};
System.out.println("????????????????" + names.length);// 3
//3.????????
String[] strArr = new String[5];
System.out.println("?????????????????" + strArr.length); // 5
???????????????????????????????????飬???????4??3??5?????????????£?
?????????????????????????????????棬?????????????????????е??????
??????????????????????????伴????????????????????????????????????????????????????????????????????????????е????????????????????????????????????????£?
????books = names;
????System.out.println("books???????????" + books.length);
????strArr = names;
????System.out.println("strArr???????????" + strArr.length);
????books[1] = "???";
????System.out.println("snames???????????" + books[1]);
?????????????
????books???????????3
????strArr???????????3
????strArr??????????????
????books????????4????????????????3????????????????????μ?????books????????????鳤???????4?????????κ????????????GC????????仯???£?
????java ?е?????????????????????????????????????????????????????Ч????????????????????????.
????int[] nums = new int[]{3??5??20??12};
????int[] prices;
????prices = nums;//prices δ????????????????nums???????????
????for (int i = 0; i < prices.length; i++) {
????System.out.println(prices[i]);
????}
????//?prices???????????
????prices[2] = 34;
????System.out.println("nums???????????????"+nums[2]);//???34
????prices???鰱??г??????????????????? prices = nums; ??????????????????????????????????prices????????????nums??????????? ???????飬???????????Ч??????????????????????
??????? ????????????????????????????????????????????÷???????????????????????????????滻??
????3.????????????????
?????????????????????????????????????洢???????????????????棬??????д洢????????????????????????????java??????
???????????Person??????????????????飺
public class Person {
public int age;
public double height;
public void printInfo() {
System.out.println("???????" + age + "?? ??????" + height);
}
}
????????person???飺
Person[] students;
students = new Person[2];
System.out.println("students???鳤???" + students.length);
Person zhang = new Person();
zhang.age = 12;
zhang.height = 158;
Person lee = new Person();
lee.age = 16;
lee.height = 161;
students[0] = zhang;
students[1] = lee;
//lee??students[1]???????person??????????????????Ч?????
lee.printInfo();
students[1].printInfo();
?????????????????????
????student???????????????????????????????zhang??lee??lee??studentd[1]?????????????????????棬???????Ч????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11