For explaining of perfect number, just see wikipedia;

https://en.wikipedia.org/wiki/Perfect_number

In range of the 1 ~ 1e8, there are only 5 perfect numbers;

6, 28, 496, 8128, 33550336

```
private static final int[] perfectNumber = {6, 28, 496, 8128, 33550336};
public boolean checkPerfectNumber(int num) {
if(num <= 0){
return false;
}
for(int i = 0; i < perfectNumber.length; i++){
if(num == perfectNumber[i]){
return true;
}
}
return false;
}
```