使用%(模数)在Java中设置变量

时间:2014-09-16 23:41:17

标签: java setvalue

我尝试使用%(模数运算符),其中我有一个数字,例如1215,我想用" x"数字,所以它显示x15 ..

我正在考虑做以下事情

x= 10;//(for example)
time = 1215;

settime = (time/100)%100;//(it's gonna get rid of the 15 and grab the 12)

settime= x;

//Now I'm stock in this part on how to set that to the time without changing the minutes("15")
//so it desplays 1015?

0 个答案:

没有答案