Class Tree
{
/**
*<br> Method Description: Tree root
*<br> input Parameters:
*<br> return type:
*/
public void root ()
{
String ssite = "soil";
String sfunction = "absorbent feed";
print ("Position:" +ssite);
Print ("function:" +sfunction);
}
/**
*<br> Method Description: Tree trunk
*<br> input Parameters:
*<br> return type:
*/
public void Bolo ()
{
String ssite = "ground";
String sfunction = "Pass The Feed";
print ("Position:" +ssite);
Print ("function:" +sfunction);
}
/**
*<br> Method Description: Tree branches
*<br> input Parameters:
*<br> return type:
*/
public void Branch ()
{
String ssite = "on the trunk";
String sfunction = "Pass The Feed";
print ("Position:" +ssite);
Print ("function:" +sfunction);
}
/**
*<br> Method Description: The leaves of the tree
*<br> input Parameters:
*<br> return type:
*/
public void leaf ()
{
String ssite = "treetop";
String sfunction = "photosynthesis";
String scolor = "green";
print ("Position:" +ssite);
Print ("function:" +sfunction);
print ("color:" +scolor);
}
/**
*<br> Method Description: Display information
*<br> input parameter: information displayed by Object Opara
*<br> return type:
*/
public void print (Object Opara)
{
System.out.println (Opara);
}
/**
*<br> Method Description: Main method
*<br> input Parameters:
*<br> return type:
*/
public static void Main (string[] arges)
{
Tree T = new tree ();
T.print ("Describe a tree:");
t.print ("root:");
T.root ();
t.print ("trunk:");
T.bolo ();
t.print ("branch:");
T.branch ();
t.print ("leaf:");
t.leaf ();
}
}
/**
* <p>title: Willow parameters </p>
* <p>description: Description of willow parameters </p>
* <p>copyright:copyright (c) 2003</p>
* <p>filename: </p>
* @author Dujiang
* @version 1.0
*/
class Osier extends tree
{
/**
*<br> Method Description: Overload tree leaves
*<br> input Parameters:
*<br> return type:
*/
public void leaf ()
{
super.leaf ();
String sshape = "long shape";
super.print ("Shape:" +sshape);
}
/**
*<br> Method Description: Extend the flower of the tree
*<br> input Parameters:
*<br> return type:
*/
public void Flower ()
{
print ("Haha, willow no flower!!") ");
}
/**
*<br> Method Description: Main method
*<br> input Parameters:
*<br> return type:
*/
public static void Main (string[] args)
{
osier o = new Osier ();
O.print ("Willow Root:");
O.root ();
o.print ("Willow Trunks:");
O.bolo ();
o.print ("Willow Branch:");
O.branch ();
o.print ("Willow Leaves:");
o.leaf ();
o.print ("Willow Flower:");
O.flower ();
}
}