public class Solution {
/**
* @param num: an integer
* @return: an integer, the number of ones in num
*/
public int countOnes(int num) {
// write your code here
int result = 0;
while(num>0){
if((num&1)==1){
result++;
}
num = num>>>1;
}
return result;
}
};