Hi all,
I created a class that has three int variables and one String, and the respective constructor method with all of them.
public class CalendarioUser {
int dia;
int mes;
int año;
String nombre;
however, in the main class (which is in another class file), I can't import the String element because it gives me the error "incompatible types: string cannot be converted to CalendarioUser (the name of my class that contains the variable)"
This is how I made it:
public static void main(String[] args) {
CalendarioUser nombreUser = new CalendarioUser();
nombreUser = nombreUser.nombre; (this part contains an error)
I can't figure it out! Why is it giving me this error? isn't supposed to be compatible with Strings if it contains a String variable?
how should I fix it? Im a beginner with Java code.
Thanks!