Q:

How to return a 2D char in java?

The given public static :
public static char[][] punkt(char[][] zf, int x, int y, char z)    

gets a drawing area zf, the geometric coordinates (x; y) and a "drawing pen" z. If the dot (x; y) is outside the drawing area, the method must return the unchanged zf ( that's the first issue I have), otherwise it replaces the entry in the zf field corresponding to (x; y) with the character z and returns the changed drawing area
I tried doing it this way but no matter what I try, I can't get it to return the unchanged "zf"
if (x > 79 || y > 39) {
 return char [][] zf;
} else //( here I should type that it should update zf with the new values of x,y and z then return)//

system.out and Arrays.fill are also not be used in this thing, only return statements :/

A:

When returning an array you only want to write return zf; without declaring a new array, do you also want a solution for your else-statement?
Edit: nvm I just add it:
if(something) {
    doSomething;
} else {
    zf[x][y] = z;
    return zf;
}

Or even better: (edited thanks to Eritrean)
if((x > 0 && x <= 79) && (y > 0 && y <= 39)) {
    zf[x][y] = z;
}
return zf;

