When creating an instance of an object with the code
Persona3 respuesta = new Persona3("","","",25,80,150f)
Get an error saying: String cannot converted to int
and the whole line appears in red.
When creating an instance of an object with the code
Persona3 respuesta = new Persona3("","","",25,80,150f)
Get an error saying: String cannot converted to int
and the whole line appears in red.
The error is found in the arguments that you pass to the constructor of the class
Persona3 respuesta = new Persona3("","","",25,80,150f)
// ^
// Esto no es un valor literal constante que |
// pueda ser reconocido por el compilador -------
//
the value 150f
is not an integer, and neither is it a string (if it is it must be enclosed in double quotes "así como este ejemplo"
)
Since the signature of the constructor is not known, I can not give you the solution, but if what you want to send is an integer, remove the letter f
that is over, and if what you want to send is a string , do not forget to enclose it in quotes, like this: "150f"
.
Also, you will need a semicolon ;
at the end of the expression.
If the class to instantiate it you have to introduce the first argument to the third string "String" and from the fourth to the sixth argument "Int", it is what the comrade says that in the sixth argument you are entering a string and not a whole
This problem is not related only to NetBeans, the problem is that some of the values that your class receives Persona3
is defined to receive a value of type int
and you are defining a value of type String
which It's wrong.
Review the implementation of your class to ensure that the values are of the type required to instantiate your class.