0
간단한 매개 변수화 된 생성자 프로그램을 작성하면 컴파일되고 명령 행에서 실행됩니다. 이 이클립스 IDE 내에서 실행되는 경우매개 변수화 된 생성자 코드 컴파일 중 Eclipse 오류
그러나, 나는 다음과 같은 예외를받은 :
Exception in thread "main" java.lang.NoSuchMethodError: a_constructor.Test.(II)V at a_constructor.ParametrizedConstructor.main(ParametrizedConstructor.java:15).
코드 :
//write a java program which listed the concept of parameterized constructor
class Test {
int a,b;
Test (int x, int y) {
a=x;
b=y;
System.out.println("========================");
System.out.println("value of a=" +a);
System.out.println("value of b=" +b);
System.out.println("========================");
}
}
public class ParametrizedConstructor {
public static void main(String[] args) {
Test t1=new Test(10,20);
Test t2=new Test(100,200);
Test t3=new Test(1000,2000);
}
}
그것은 나를 –
청소를 위해 잘 작동을 수행하고, – Jens
문제 없음 여기 중 하나를 프로그램을 다시 실행 깨끗한 프로젝트 또는 다시 시작 Ecli pse. Eclipse에서 의심되거나 의심스러운 오류가 발생하면 온라인 컴파일러/IDE를 사용하여 코드를 확인할 수 있습니다 (예 : http://www.tutorialspc.com/components.htm – Fr333du