I have the following code and when I try to write the method rellenarTipo
I get an error, I have created a main class called main
and another class called subclase
that inherits main
where when @Override
is when it tells me error
public class main {
public static void main(String[] args) {
rellenarTipo();
}
public static void rellenarTipo() {
String dni, nombre;
Scanner scan = new Scanner(System.in);
System.out.println("introduza nombre");
nombre = scan.next();
System.out.println("introduzca dni");
dni = scan.next();
}
}
And this is the subclass that inherits from the class main
and where I want to escirbir fill type, someone guides me a bit to know what I do wrong?
public class SubClase extends main {
int edad;
@Override
public static void rellenarTipo(){
System.out.println("introduzca edad");
}
}