import java.util.*;
package Classexercise4_6;public class array1 {
public static void main(String[] args){
int[]a = new int[10];
Scanner s= new Scanner(System.in);
System.out.println("请输入要访问的数组的索引:");
int index = s.nextInt();
System.out.println("位置"+index+"处的索引为:"+a[index]);
}}
刚刚开始学习Java,编辑以上代码,出现Syntax error on token "package", import expected错误,请各位大侠指点~
package Classexercise4_6;public class array1 {
public static void main(String[] args){
int[]a = new int[10];
Scanner s= new Scanner(System.in);
System.out.println("请输入要访问的数组的索引:");
int index = s.nextInt();
System.out.println("位置"+index+"处的索引为:"+a[index]);
}}
刚刚开始学习Java,编辑以上代码,出现Syntax error on token "package", import expected错误,请各位大侠指点~
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货