KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > puppycrawl > tools > checkstyle > bcel > checks > SubClass


1 package com.puppycrawl.tools.checkstyle.bcel.checks;
2
3 public class SubClass extends SuperClass
4 {
5     protected int reusedName;
6     private int subClassPrivate;
7     protected int superClassPrivate;
8     protected int differentType;
9     public static String JavaDoc S="S";
10     public static int staticMethod() {
11         return 1;
12     }
13     public int nonStaticMethod() {
14         return 1;
15     }
16     public static int staticMethodSameParamName(int i) {
17         return 1;
18     }
19     public static int staticMethodSameParamType(int x) {
20         return 1;
21     }
22     public static int staticMethodDifferentParamNum(int i) {
23         return 1;
24     }
25     public static int staticMethodDifferentParamType(String JavaDoc i) {
26         return 1;
27     }
28     public static int staticMethodDifferentObjectType(String JavaDoc i) {
29         return 1;
30     }
31     public static int staticMethodSuperParamType(String JavaDoc i) {
32         return 1;
33     }
34     public void callStaticMethodWithObject() {
35         SubClass s = new SubClass();
36         s.staticMethod();
37     }
38     public void callStaticMethodWithClass() {
39         SubClass.staticMethod();
40     }
41     public void callStaticMethodWithThis() {
42         this.staticMethod();
43     }
44     public String JavaDoc callStaticFieldWithObject() {
45         SubClass s = new SubClass();
46         return s.S;
47     }
48     public String JavaDoc callStaticFieldWithClass() {
49         return SubClass.S;
50     }
51     public String JavaDoc callStaticFieldWithThis() {
52         return this.S;
53     }
54 }
55
Popular Tags