this.something = something - problem with "double"
I have a rather simple problem, but I can't solve it somehow.
Code :
class lokomotiva extends element{
public lokomotiva(double maxMasa){
super(maxMasa);
this.maxMasa = maxMasa;
}
}
when i try to compile the whole thing (this is just a part of the code), I get an error:
possible loss of precision
found :double
required: int
at: this.maxMasa = maxMasa
maxMasa is a double number, and I want it to be, but how to assign it to an object?
Any help would be appriciated
Re: this.something = something - problem with "double"
I'm guessing that maxMasa in the element class is an int, can you verify the type in the element class?
Re: this.something = something - problem with "double"
I don't know how could I have missed that. It works now. Thx m8.