subclass.java

来自「Checkstyle 可寻找:·不能使用的或者多余的输入 ·空格更好的地方不使用」· Java 代码 · 共 55 行

JAVA
55
字号
package com.puppycrawl.tools.checkstyle.bcel.checks;

public class SubClass extends SuperClass
{
    protected int reusedName;
    private int subClassPrivate;
    protected int superClassPrivate;
    protected int differentType;
    public static String S="S";
    public static int staticMethod() {
        return 1;
    }
    public int nonStaticMethod() {
        return 1;
    }
    public static int staticMethodSameParamName(int i) {
        return 1;
    }
    public static int staticMethodSameParamType(int x) {
        return 1;
    }
    public static int staticMethodDifferentParamNum(int i) {
        return 1;
    }
    public static int staticMethodDifferentParamType(String i) {
        return 1;
    }
    public static int staticMethodDifferentObjectType(String i) {
        return 1;
    }
    public static int staticMethodSuperParamType(String i) {
        return 1;
    }
    public void callStaticMethodWithObject() {
        SubClass s = new SubClass();
        s.staticMethod();
    }
    public void callStaticMethodWithClass() {
        SubClass.staticMethod();
    }
    public void callStaticMethodWithThis() {
        this.staticMethod();
    }
    public String callStaticFieldWithObject() {
        SubClass s = new SubClass();
        return s.S;
    }
    public String callStaticFieldWithClass() {
        return SubClass.S;
    }
    public String callStaticFieldWithThis() {
        return this.S;
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?