2つの整数を生成していましたが、分割しました。私は2つの整数を整数または10進数で区切った結果を確認したい。次に、結果を比較しようとし、結果をこのコードで文字列に統合しますが、その動作は停止します。除算の結果がintか浮動小数点かどうかを確認する方法
Random r = new Random();
int first = r.nextInt(50 - 1) + 1;
Random z = new Random();
int twond = z.nextInt(50 - 1) + 1;
float Resultas = (first/twond);
Result = (int) Resultas;
String floatResult = Float.toString(Resultas);
while (floatResult != String.valueOf(Result)) {
Random s = new Random();
first = s.nextInt(50 - 1) + 1;
Random y = new Random();
twond = y.nextInt(50 - 1) + 1;
Resultas = (first/twond);
Result = (int) Resultas;
floatResult = Float.toString(Resultas);
}
使用[TypeVariable(https://developer.android.com/reference/java/lang/reflect/TypeVariable.html).. –
なぜ作業コードを停止します。例外が発生し、これをあなたの質問に追加できますか? [質問する](http://stackoverflow.com/help/how-to-ask)をお読みください。 –
H. Pauwelyn私はあなたが話していることを理解していません。 – Fachri