Hello people.
I have the following class.

public class Model{
      private Kutia[][] c;
   
   
      public Model(Kutia[][] x){
         c = touch(x);
      
      }
   	
      public void touch(Kutia[][] k){
         for(int i = 0; i < 8; i++){
            for(int j = 0; j < 8; j++){
               if(k[i][j].occupied()){
                  touchHorizontal(k, i, j);
                  touchVertical(k, i, j);						
               }
            }
         }
      }
   
      public void touchHorizontal(Kutia[][] k, int i, int j){
         for(int r = 0; r < 8; r++){
            if(r != j){
               k[r][j].increaseVlera();
            }
         }
      }
   
      public void touchVertical(Kutia[][] k, int i, int j){
         for(int r = 0; r < 8; r++){
            if(r != i){
               k[i][r].increaseVlera();
            }
         }	
      }
   
   
      public Kutia[][] modeled(){
         return c;
      }
   
   }

Compiler is complaining for line six - incompatible types. I don't get it: how is a Kutia[][] object incompatible with another Kutia[][] object. please help.

Your touch method is a void return

public void touch(Kutia[][] k)

You can't assign that to your 'c' variable.

I replaced line six with the following two lines, and expect it to work find. (in case some other reader may be interested)

c = x;
	touch(c);
This question has already been answered. Start a new discussion instead.