-
Simple coding problem
Code:
public class TextGraph{
private char[][] screen;
private int scrW;
private int scrH;
public TextGraph(){}
public TextGraph(int x, int y){
scrW=x;
scrH=y;
screen= char[scrW][scrH];
}
}
What is wrong with this line of code? I can't compile..it says something wrong at
Code:
screen= char[scrW][scrH];
-
what's the exact exception you get?
and how do you call the TectGrap(x,y) constructor?
-
Try this:
Code:
screen= new char[scrW][scrH];
-
Ah, i forgot arrays are objects..have to use 'new' keyword..