免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
數(shù)組動態(tài)初始化
 
==============================練習一======================== 
/*
數(shù)組
*/
class LianXi{
 public static void main(String [] args){
  int [] arr =new int[3] ;
  System.out.println(arr);
  System.out.println(arr[0]);
  System.out.println(arr[1]);
  System.out.println(arr[2]);
 }

結果:
[I@e6f7d2
0
0
0
=======================練習二===========================
/*
數(shù)組 賦值
*/
class LianXi{
 public static void main(String [] args){
  int [] arr =new int[3] ;
  arr[0] = 10;
  System.out.println(arr);
  System.out.println(arr[0]);
  System.out.println(arr[1]);
  System.out.println(arr[2]);
  System.out.println("============");
  int [] arr1 = arr;
  arr1[2] =20;
  System.out.println("arr = "+arr);
  System.out.println("arr[0] = "+arr[0]);
  System.out.println("arr[1] = "+arr[1]);
  System.out.println("arr[2] = "+arr[2]);
  System.out.println("============");
  System.out.println("arr1 = "+arr1);
  System.out.println("arr1[0] = "+arr1[0]);
  System.out.println("arr1[1] = "+arr1[1]);
  System.out.println("arr1[2] = "+arr1[2]);
 }

結果:
[I@55e55f
10
0
0
============
arr = [I@55e55f
arr[0] = 10
arr[1] = 0
arr[2] = 20
============
arr1 = [I@55e55f
arr1[0] = 10
arr1[1] = 0
arr1[2] = 20
本站僅提供存儲服務,所有內容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權內容,請點擊舉報
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
foreach
(Java)尋找最大值
Java開發(fā)新手冒泡排序
查找某個元素在數(shù)組中對應的索引
選擇排序詳解(Java實現(xiàn))
華為機試題
更多類似文章 >>
生活服務
分享 收藏 導長圖 關注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服