좀 올릴게요 ..
제가 독학을 하느라 막혀도 누구하나 물어볼사람이 없네요 ..
좀 도와주셧으면 합니다..
전화번호 프로그램을 만들고 있는데요.
1번은 데이터입력
2번은 데이터 검색
3번은 데이터 삭제
4번은 프로그램 종료

식으로 구성되어잇는것인데요 ..
분명히 굵은글씨부분에 showphoneinfo 라는 메소드가 없는데 메소드를 호출하고잇는게 보이잖아요.
근데 책에서는 저렇게 호출을 하고 계시더라구요..
킁킁.. 코드를 샅샅히 뒤져봐도 저 메소드가 없는데 어디서 저렇게 호출하는지 잘 모르겟습니다.
도와주시면 감사하겟습니다.


import java.util.Scanner;

public class phonebookver03
{
 public static void main(String args[])
 {
  phonebookmanager manager = new phonebookmanager();
  int choice;
  
  while(true)
  {
   showof.showofshow();
   choice = showof.keyboard.nextInt();
   showof.keyboard.nextLine();
   
   switch(choice)
   {
   case 1:
    manager.inputdata();
    break;
    
   case 2:
    manager.search();
    break;
   
   
    
   }
  }
 }
}

class phoneinfo
{
 String namename;
 String phonephone;
 String birthbirth;
 
 public phoneinfo(String named,String phonenum,String birthday)
 {
  namename = named;
  phonephone = phonenum;
  birthbirth = birthday;   
 }
 
 public phoneinfo(String named,String phonenum)
 {
  namename = named;
  phonephone = phonenum;
  birthbirth = null;
 }
 
 public void showofresult()
 {
  System.out.println("이름 " + namename); 
  System.out.println("핸드폰번호  : " + phonephone);
  if(birthbirth != null)
  {
   System.out.print("생일 " + birthbirth);
  }
  else
  {
   System.out.print("생일이 없다 ");
  }  
 }
}


class phonebookmanager
{
 final int max_cnt = 100;
 int curcnt = 0;
 phoneinfo[] infomaster = new phoneinfo[max_cnt];
 
 public void inputdata()
 {
  System.out.println("데이터 입력을 시작합니다.. ");
  System.out.print("이름 : ");
  String name = showof.keyboard.nextLine();
  System.out.print("전화번호 : ");
  String phone = showof.keyboard.nextLine();
  System.out.print("생년월일 : ");
  String birth = showof.keyboard.nextLine();
  
  infomaster[curcnt++] = new phoneinfo(name,phone,birth);
  System.out.println("데이터 입력이 완료되었습니다 ");
 }
 
 public void search()
 {
  System.out.println("데이터 검색을 시작합니다 ");
  System.out.print("이름 : ");
  String name = showof.keyboard.nextLine();
  
  int dataindex = search(name);
  
  if(dataindex<0)
  {
   System.out.println("해당 데이터가 존재하지 않습니다 ");
  }
  else
  {
   infomaster[dataindex].showphoneinfo();
   System.out.println("데이터 검색이 완료되었습니다 ");
  }
 }
 
 private int search(String name)
 {
  
  for(int idx = 0; idx<curcnt; idx++)
  {
   phoneinfo curinfo = infomaster[idx];
   
   if(name.compareTo(curinfo.namename)==0)
    return idx;
  }
  return -1;
 }
}

 


class showof
{
 public static Scanner keyboard = new Scanner(System.in);
 public static void showofshow()
 {
  System.out.println("1. 데이터 입력 ");
  System.out.println("2. 데이터 검색 ");
  System.out.println("3. 데이터 삭제 ");
  System.out.println("4. 프로그램 종료 ");
  System.out.print("선택 : ");
 }
}