0
for(int x=0;x<n;x++){
BT[x]=0;
WT[x]=0;
JB[x]=0;
s1[x]=" ";
s2[x]=" ";
}
我無法初始化字符串s1和s2它給我錯誤數組必需但字符串發現錯誤。需要的數組但字符串發現錯誤
int n,BT[],WT[],JB[];
String s1[];
String s2[];
String s=JOptionPane.showInputDialog("Enter no of process");
//System.out.println("Enter no of process");
n=Integer.parseInt(s);//sc.nextInt();
BT=new int[n+1];
WT=new int[n+1];
JB=new int[n+1];
s1=new String[n+1];
s2=new String[n+1];
這是設置固定它的s1的陣列大小和s2