Java Float zu Lange Typecast

Kann mir jemand sagen was ich falsch mache hier. Ich bin in der Lage zu festgelegten y in lange, aber das gleiche funktioniert nicht bei x/y.

class Test {

long convert(int x, float y) {
    //return (long) x/y; //cannot convert from float to long
    return (long)y;
    }

}
InformationsquelleAutor ncst | 2013-07-09
Schreibe einen Kommentar