Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javalab;
- class company{
- void type(){
- System.out.println("Buisness");
- }
- }
- class name extends company{
- void brand(){
- System.out.println("google");
- }
- }
- class product extends company{
- void product(){
- System.out.println("Google drive");
- }
- }
- public class herarchical extends toyota{
- public static void main(String[] args) {
- product p1=new product();
- p1.company();
- p1.brand();
- p1.product();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement