public class shuzhu{
public static void main(String[] args){
int age[ ]={22,23,24};
System.out.println(age[0]);
System.out.println(age[1]);
System.out.println(age[2]);
String names[ ]={"张x","王x","李x"};
System.out.println(names[0]);
System.out.println(names[1]);
System.out.println(names[2]);
}}
出现错误:少了字符串的引号,和表达式的分号用的全角。
成功运行: