Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

i cant understand what i return in methods

$
0
0
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
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;}
}

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>