Code: Select all
class Paper200823{
public static void main(String args[]){
char a[]={o , o , h};
char b[]={k , s , a};
char c[]= new char[6];
for (int i=0,k=0,m=0;i<=c.length-1; ++i)
{
if(i%2 == 0){
c[i] = a[k];
k++;
}else{
c[i] = b[m];
m++;
}
}
for (int i=0;i<=c.length-1; ++i)
System.out.print(c[i]);
}
}
This is a theory question I found in a book.I can understand about the first error.In array a.but I can't understand the error of array b...can you please tell me about the second error in char b[]={k , s , a}; line..
friend,may be these are some odd question to this forum.because these are theory based questions.I am asking this because Expertcore is the one & only place I better know..& with trusted friends.