Warning: session_destroy() [function.session-destroy]: Session object destruction failed in /home/httpd/html/board/include/header.php on line 32
적수네 동네 - 질문과 답변 [ 게시물 삭제 ]
>> Delete No. 59580 article
No. [자바질문(__)] 자바 질문해서 죄송한데요. 너무
답답해서요.-o-

등록 2002-10-23 18:33:00 By localhost     조회 8
이름 snake1024    

		public class Direction {
   int vert;
  int horiz;
  Direction(){
    super();
  }
  Direction(int vert, int horiz){
    setDirection(vert, horiz);
  }
  public void setDirection(int vert, int horiz){
    this.vert = vert;
    this.horiz = horiz;
  }
   int getVert(){
    return vert;
  }
  int getHoriz(){
    return horiz;
  }
 }
 public class Maze {
   public static void main(String<> args){
     Direction<> move = new Direction[8];
    move[0].setDirection(-1, 0);
    move[1].setDirection(-1, 1);
    move[2].setDirection(-1, 0);
    move[3].setDirection(1, 1);
    move[4].setDirection(1, 0);
    move[5].setDirection(1, -1);
    move[6].setDirection(0, -1);
    move[7].setDirection(-1, -1);
  }
}
 위와같이 하면 컴파일은 되는데, 실행하면 NullPointerException이 발생합니다.
move[0]라인에서 걸리는데요. 8개 배열 선언했는데, 왜그런지 모르겠어요.
조언 부탁 드립니다.(__)
[관리자] 패스워드를 입력 하십시오. 답장이 존재하면 함께 삭제됩니다.[ 목록 | 이전 ]
패스워드:    

Copyleft 1999-2026 by JSBoard Open Project
Theme Designed by IDOO All right reserved