private 메서드를 보고합니다. 이러한 메서드는 해당 내부 클래스로 안전하게 이동할 수 있습니다.
예:
public class Outer {
public static void main(String[] args) {
new Inner().run(args[0]);
}
static class Inner {
void run(String arg) {
// isEmpty() 메서드는 내부 클래스에서만 사용됩니다
// 내부 클래스로 이동을 고려해보세요
if (!isEmpty(arg)) {
System.out.println("Argument is supplied");
}
}
}
private static boolean isEmpty(String s) {
return s != null && s.trim().isEmpty();
}
}
익명 또는 지역 클래스에서 호출되는 private 메서드를 무시하려면 아래 첫 번째 체크박스를 사용합니다.
세 번째 체크박스는 static 메서드를 보고할 때만 사용합니다.