Hellow i have to make a methods of an interface Appendable.
I have make a class with a constractor which make an char array and use the methods in this array but i cant what i reaturn of methods Appendable i confused beacuse the tell in home work i have a char array in my class ArrayAppendable and the methods use this array ok, but in the return i cant put the array ?
hear is the code
I have make a class with a constractor which make an char array and use the methods in this array but i cant what i reaturn of methods Appendable i confused beacuse the tell in home work i have a char array in my class ArrayAppendable and the methods use this array ok, but in the return i cant put the array ?
hear is the code
public class ArrayAppendable implements Appendable{
static char[] array;
public ArrayAppendable(char[] myArray){
array = new char[myArray.length];
for(int i=0;i<myArray.length;i++)
array[i]=myArray[i];
}
public static void toChar(){
for(int i=0;i<array.length;i++)
System.out.println(i+" : "+array[i]);
}
static Appendable append(char c) throws IOException{
int i=0;
while(array.length<i){
if(array[i]=='\0'){
array[i]=c;
break;}
i++;
}
return ;}
static Appendable append(CharSequence csq){
return null;}
}