KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > csdl > foo > Bar


1 package csdl.foo;
2
3 /**
4  * Main class in stand-alone system example that is tested by test classes TestBar and TestBar2.
5  * <p>
6  * All methods prints their name to the screen when invoked.
7  *
8  * @author Joy M. Agustin
9  * @version $Id: Bar.java,v 1.2 2003/01/25 01:48:57 jagustin Exp $
10  */

11 public class Bar extends Foo {
12
13   /**
14    * Prints method name to screen then calls methodB(int a)
15    * @return 0
16    */

17   public int methodA() {
18     System.out.println("Bar: methodA");
19     return 0;
20   }
21
22   /**
23    * Prints method name and parameter types to screen.
24    *
25    * @param a Description of the Parameter
26    * @param b Description of the Parameter
27    */

28   public void methodB(String JavaDoc a, Integer JavaDoc b) {
29     System.out.println("Bar: methodB(String, Integer)");
30   }
31
32   /**
33    * The main program for the Foo class. It prints out the method name, creates a new instance
34    * of the Foo class, then calls methodA twice.
35    *
36    * @param args The command line arguments
37    */

38   public static void main(String JavaDoc[] args) {
39     System.out.println("Bar: main");
40     Bar bar = new Bar();
41     bar.methodB(1);
42     bar.methodB(2);
43   }
44 }
45
Popular Tags