KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > umd > cs > findbugs > gui > Hello


1 /*
2  * FindBugs - Find bugs in Java programs
3  * Copyright (C) 2003,2004 University of Maryland
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */

19
20 /*
21  * Hello.java
22  *
23  * Created on March 29, 2003, 1:52 AM
24  */

25
26 package edu.umd.cs.findbugs.gui;
27
28 /**
29  * This is just a test of creating a class in NetBeans.
30  *
31  * @author David Hovemeyer
32  */

33 public class Hello {
34
35     private String JavaDoc toWhom;
36
37     /**
38      * Creates a new instance of Hello.
39      */

40     public Hello() {
41         this.toWhom = "you";
42     }
43
44     /**
45      * Creates a new instance of Hello.
46      *
47      * @param toWhom person to greet
48      */

49     public Hello(String JavaDoc toWhom) {
50         this.toWhom = toWhom;
51     }
52
53     /**
54      * Display a friendly greeting.
55      */

56     public void greet() {
57         System.out.println("Hello, " + toWhom);
58     }
59
60     /**
61      * @param args the command line arguments
62      */

63     public static void main(String JavaDoc[] args) {
64         Hello h;
65         if (args.length > 0)
66             h = new Hello(args[0]);
67         else
68             h = new Hello();
69         h.greet();
70     }
71
72 }
73
Popular Tags