while the code in java sometimes i wanted to use signed integer type. but like C++ coudn't find a way to use signed int. so thought about a way to convert negative integers to positive.
int integerVariable;
integerVariable =-20;
//now convert negative values to positive
if(integerVariable<0)
integerVariable=0-integerVariable;
now just use integerVariable as your wish. it will only contain positive values.
Um... Math.abs()?
ReplyDelete@thameera
ReplyDeletewanna try :)
thanx for the comment