Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. Every Student is Human, And Teacher is also Human.
  2.  
  3. Human have some properties like height, weight (vurir ojon arki :p) , skinColor. And have a common behavior speak() {mane kivabe kotha bole, aste naki jore :p} , eat() {mane ki khay, alu vorta naki biriyani :p}
  4.  
  5. Student have some extra properties such as id, dept and have some behavior such as howHeRead(){mane mone mone pore naki chillaiya chillaiya pore :p}
  6.  
  7. Teacher have some extra properties like dept, subjectHeTaught and some extra behavior howHeTeach(){ khub valo kore poray naki zia chachar moto balbal kore poray :p }
  8.  
  9. There will be an interface named Information which will have one method named printInformation();
  10.  
  11. Now, the main class will be like bellow:
  12.  
  13. public class MainClas{
  14. public static void main(String[] args){
  15. Human student = new Student(5.5,70,"dudhe Alta",16060,"ICT");
  16. student.speak();
  17. student.howHeRead();
  18. student.printInformation();
  19.  
  20. Human teacher = new Teacher(5.5,55,"Kailla","ICT","Java");
  21. teacher.speak();
  22. teacher.howHeTeach();
  23. teacher.printInformation();
  24. }
  25.  
  26. }
  27.  
  28.  
  29. Create a object oriented scenario.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement