Advertisement
shawonrog

hierarchicalInheritance

Mar 19th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. package javalab;
  2.  
  3. class company{
  4. void type(){
  5. System.out.println("Buisness");
  6. }
  7. }
  8. class name extends company{
  9. void brand(){
  10. System.out.println("google");
  11. }
  12. }
  13. class product extends company{
  14. void product(){
  15. System.out.println("Google drive");
  16. }
  17. }
  18.  
  19. public class herarchical extends toyota{
  20.  
  21. public static void main(String[] args) {
  22. product p1=new product();
  23. p1.company();
  24. p1.brand();
  25. p1.product();
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement