package C05;import java.util.Scanner;public class Arr {public static void main(String args[]){double[] prices;//静态初始化:数组初始化与数组元素赋值同时进行prices = new double[]{20.32,43.21,43.22};String [] foods = new String[4];//动态初始化:数组初始化与数组元素赋值分开进行String [] red = new String[4];//数组长度一旦确定,就不可更改int[] are;System.out.println(prices[0]);System.out.println(prices[1]);foods[0] = "龙须菜";foods[1] = "拌海蜇";foods[2] = "酱茄子";foods[3] = "炒鸡蛋";System.out.println(foods.length);System.out.println(prices.length);for(int i = 0;i < foods.length;i++){System.out.println(foods[i]);}//char顺序表初始化内部为0或'\u0000'char[] ar4 = new char[4];for (int i = 0; i < ar4.length; i++) {System.out.println(ar4[i]);if(ar4[i] == 0){System.out.println(1);}if(ar4[i] == '\u0000'){System.out.println(2);}}String[] s = new String[5];System.out.println(s[0]);int[] a1 = new int[]{1,2,3};int[] a2 = a1;a2[1] = 10;System.out.println(a2[1]);System.out.println(a1[1]);int[] arr = new int[]{8,2,1,0,3};int[] index = new int[]{2,0,3,2,4,0,1,3,2,3,3};String tel = "";for (int i = 0; i < index.length; i++) {int value = index[i];tel += arr[value];}System.out.println(tel);System.out.println("请输入今天周几");String[] days = new String[]{"周一","周二","周三","周四","周五","周六","周天"};Scanner in = new Scanner(System.in);int qe = in.nextInt();if(qe > 7 || qe < 1){System.out.println("输入有误");}else{System.out.println(days[qe-1]);}} }