Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Every Student is Human, And Teacher is also Human.
- 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}
- 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}
- 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 }
- There will be an interface named Information which will have one method named printInformation();
- Now, the main class will be like bellow:
- public class MainClas{
- public static void main(String[] args){
- Human student = new Student(5.5,70,"dudhe Alta",16060,"ICT");
- student.speak();
- student.howHeRead();
- student.printInformation();
- Human teacher = new Teacher(5.5,55,"Kailla","ICT","Java");
- teacher.speak();
- teacher.howHeTeach();
- teacher.printInformation();
- }
- }
- Create a object oriented scenario.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement