Coach Class Trainger.java
public class trainger{
the material carrier necessary to complete a method
Private car car=new car ();
the functions that the class has
public void trainning () {
System.out.println (" coaches begin to teach students to practice cars ");
Car.runstraight ();
Car.runcurse ();
Car.runbehind ();
System.out.println (" Coach trainer completed ");
}
}
Car Class Car.java
public class car{
public void Runstraight () {
System.out.println ("The coach is teaching the students to go straight .... ");
System.out.println ("");
}
public void Runcurse () {
System.out.println ("The coach is teaching the students to drive the curve ....") ");
System.out.println ("");
}
public void Runbehind () {
System.out.println (" Coach is teaching students to reverse the storage ....) ");
System.out.println ("");
}
}
Test.java
public class test{
public static void Main (string[] args) {
Trainger Zhangsan =new Trainger ();
Zhangsan. trainning ();
}
}
Coach with car trainer (class structure)