class Ball {
 int x, y;
 int rad;
 int dx, dy;
 int color;
 int count;
 // 새로운 볼 생성
 static Ball Create(int x, int y, int Rad) {
  Random Rnd = new Random();
  Ball NewBall = new Ball();
  NewBall.x = x;
  NewBall.y = y;
  NewBall.rad = Rad;
  do {
   NewBall.dx = Rnd.nextInt(11) - 5;
   NewBall.dy = Rnd.nextInt(11) - 5;
  } while (NewBall.dx == 0 || NewBall.dy == 0);
  NewBall.count = 0;
  NewBall.color = Color.rgb(Rnd.nextInt(256), Rnd.nextInt(256), Rnd.nextInt(256));
  return NewBall;
 }
 // 볼 이동
 void Move(int Width, int Height) {
  x += dx;
  y += dy;
  if (x < rad || x > Width - rad) {
   dx *= -1;
   count++;
  }
  if (y < rad || y > Height - rad) {
   dy *= -1;
   count++;
  }
 


----------------------------------------------------------------------
안녕하세요. 안드로이드 초보입니다.
안드로이드 완전 정복을 참고하면서 공부하던 중에 모르는 부분이 나와서 질문드립니다.
제가 색으로 표시한 부분인데요. static 메소드 인것 같은데. 메소드 명이 두 개인 것인가요?
특히 Ball 의 의미를 모르겠습니다. 리턴형을 표시한 것인지 헷갈리네요.
하루종일 구글링 하다가 답답해서 올려봅니다. 
초보적인 질문이지만 답변 부탁드립니다.
profile