daily pastebin goal
22%
SHARE
TWEET

Untitled

a guest Feb 19th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. abstract class Person {
  3.    
  4.     String nume;
  5.     String prenume;
  6.     int cnp;
  7. public
  8.     abstract void setNume(String m_nume);
  9.     abstract void setPrenume(String m_prenume);
  10.     abstract void setCnp(int m_cnp);
  11. }
  12.  
  13.  
  14.  
  15. abstract class Doctor extends Person{
  16.    
  17.     String studies;
  18.     String activity;
  19.     String officeAdress;
  20.     String assistentName;
  21.     public
  22.     Doctor()
  23.     {
  24.         setStudies("UMF");
  25.     }
  26.     abstract void setActivity(String m_activ);
  27.     abstract void setOfficeAdress(String m_officeAdress);
  28.     abstract void setAssistentName(String m_assistentName);
  29.     abstract void getDate();
  30.    
  31.     void setStudies(String m_studies)
  32.     {
  33.         studies=m_studies;
  34.     }
  35. }
  36.  
  37.  
  38.  
  39.  
  40.  
  41. public class Stomatologist extends Doctor {
  42.    
  43.    
  44.     public
  45.     void setNume(String m_nume)
  46.     {
  47.         nume=m_nume;
  48.        
  49.     }
  50.    
  51.     void setPrenume(String m_prenume)
  52.     {
  53.         prenume=m_prenume;
  54.        
  55.     }
  56.     void setCnp(int m_cnp)
  57.     {
  58.         cnp=m_cnp;
  59.        
  60.     }
  61.     void setActivity(String m_activ)
  62.     {
  63.         activity=m_activ;
  64.        
  65.     }
  66.         //Only Stomatologist
  67.     void setOfficeAdress(String m_officeAdress)
  68.     {
  69.         officeAdress=m_officeAdress;
  70.        
  71.     }
  72.     void setAssistentName(String m_assistentName)
  73.     {
  74.         assistentName=m_assistentName;
  75.        
  76.     }
  77.    
  78.     void getDate()
  79.     {
  80.         System.out.println(nume+" "+prenume+" "+cnp);
  81.         System.out.println(studies+" "+activity);
  82.         System.out.println(officeAdress);
  83.         System.out.println(assistentName);
  84.        
  85.     }
  86.    
  87. }
  88.  
  89.  
  90.  
  91. public class testStomatologist {
  92.         public static void main(String[] args) {
  93.             Doctor myStomatolog=new Stomatologist();
  94.            
  95.             myStomatolog.setNume("Vasile");
  96.             myStomatolog.setPrenume("Costel");
  97.             myStomatolog.setCnp(123456);
  98.             myStomatolog.setActivity("Cure Teeth");
  99.             myStomatolog.setOfficeAdress("Ionian St. Nb. 12");
  100.             myStomatolog.setAssistentName("MarinelaOana");
  101.             myStomatolog.getDate();
  102.         }
  103. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top