説明
変数を他の定数や変数で割るための便利な略記法です。
構文
x /= y; // equivalent to the expression x = x / y;
x | int、float、double、byte、short、long |
y | ゼロではない変数または定数int、float、double、byte、short、long |
コード例
x = 2; x /= 2; // x now contains 1
変数を他の定数や変数で割るための便利な略記法です。
x /= y; // equivalent to the expression x = x / y;
x | int、float、double、byte、short、long |
y | ゼロではない変数または定数int、float、double、byte、short、long |
x = 2; x /= 2; // x now contains 1