Source of TestGreetings.java


  1: //TestGreetings.java
  2: //Accesses methods from the package misc.greetings
  3: //in various ways.

  5: import misc.greetings;
  6: //import misc.greetings.French

  8: public class TestGreetings
  9: {
 10:     public static void main(String[] args)
 11:     {
 12:         English.SayHello();
 13:         English.SayHi();
 14:         French.SayBonjour();
 15:         German.SayGutenTag();

 17: /*
 18:         //The following fully-qualified method calls
 19:         //work without the above import statement.

 21:         misc.greetings.English.SayHello();
 22:         misc.greetings.English.SayHi();
 23:         misc.greetings.French.SayBonjour();
 24:         misc.greetings.German.SayGutenTag();
 25: */
 26:         
 27: /*
 28:         //The following method call works if you
 29:         //import just the required package class.
 30:         French.SayBonjour();
 31: */
 32:     }
 33: }