Advertisement
Anik_Akash

aa

Jul 4th, 2021
1,047
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.90 KB | None | 0 0
  1. package com.company;
  2. class NecessaryThings{
  3.     private String Oxygen;
  4.     private String Wood;
  5.     private String Pulp;
  6.     private String Shade;
  7.     private String Shelter;
  8.     private String Frutis;
  9.  
  10. }
  11. class Tree extends NecessaryThings{
  12.     public Tree(){
  13.         super();
  14.     }
  15.     private float Roots;
  16.     private float Trunk;
  17.     private String Crown;
  18.     private int Branches;
  19.     private String leaves;
  20.     private Object String;
  21.     private int NumberOfFruties;
  22.  
  23.     public String getLiving_Time(){
  24.         return (java.lang.String) (String = "since 1971");
  25.     }
  26.     public int getGiving_Fruits(){
  27.        return  NumberOfFruties;
  28.     }
  29. }
  30. class EverGreen extends Tree{
  31.    
  32. }
  33. class Deciduous extends Tree{
  34.    
  35. }
  36. public class Earth {
  37.     public static void main(String[] args) {
  38.         EverGreen Tree1 = new EverGreen();
  39.         Deciduous Tree2 = new Deciduous();
  40.     }
  41. }
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement