정적 메서드에서 비 정적 메서드를 호출 할 (액세스 할 수 있습니까? 마찬가지로 정적 메서드가 있다면 예, 어떻게 ??정적 메서드에서 비 정적 메서드 호출
public static void method() //like this is a static method
{
methodsec(); //from here I want to access non static method defined below
}
public void methodsec() // non static method
{
}
정확한 중복, http://stackoverflow.com/questions/1947533/triggering-a-non-static- class-from-a-static-class/1947541 # 1947541 –
왜 이렇게해야합니까? 약간의 코드 냄새가 나는 것처럼 보입니다 –
@Andrew Hare - 나는 그것이 중복이라는 것을 확신합니다. 그러나 그 질문은 아닙니다. 하나는 사건에 관한 것입니다. – Kobi