I’m trying to learn Java, but I have a problem with passing an array to constructor.
For example:
Application class:
byte[][] array = new byte[5][5];
targetClass target = new targetClass(array[5][5]);
Target class:
public class targetClass {
/* Attributes */
private byte[][] array = new byte[5][5];
/* Constructor */
public targetClass (byte[][] array) {
this.array[5][5] = array[5][5];
}
}
I’d greatly appreciate it if you could show me how I can do that.
First, usually class names in Java starts with Upper case, now, to the problem you met, it should be: