KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > examples > ConstructExample


1 /* ****************************************************************************
2  * ConstructExample.java
3  * ****************************************************************************/

4
5 /* J_LZ_COPYRIGHT_BEGIN *******************************************************
6 * Copyright 2001-2004 Laszlo Systems, Inc. All Rights Reserved. *
7 * Use is subject to license terms. *
8 * J_LZ_COPYRIGHT_END *********************************************************/

9
10 package examples;
11
12 public class ConstructExample {
13
14     int mInt = 0;
15     String JavaDoc mString = "";
16     double mDouble = 0.0;
17
18     public ConstructExample(int i) {
19         mInt = i;
20     }
21
22     public ConstructExample(int i, String JavaDoc s, double d) {
23         mInt = i;
24         mString = s;
25         mDouble = d;
26     }
27
28     public String JavaDoc getInfo() {
29         return "int: " + mInt + "\n"
30             + "string: " + mString + "\n"
31             + "double: " + mDouble + "\n";
32     }
33 }
34
Popular Tags