Error NoSuchMethodError in the constructor with int

1

I have this program:

package prueba;

import clases.Persona;


public class Descuentos {

public static void main(String[] args) {

    Persona p = new Persona();
    p.setEdad(20);






}

}

and this class:

package clases;

public class Persona {
 String nombre;
 int numero;
 int edad;
 double salario;

public Persona(int numero){
    this.numero = numero;
}

public Persona() {


}

public int getEdad() {
    return edad;
}

public void setEdad(int edad) {
    this.edad = edad;
}

public double getSalario() {
    return salario;
}

public void setSalario(double salario) {
    this.salario = salario;
}

} When I unlock it, I get this exception:

java.lang.NoSuchMethodError: clases.Persona.<init>(Ljava/lang/String;I)V

Do you know what the reason is?

    
asked by bsg 07.03.2018 в 09:46
source

0 answers