Design a method which accepts a number and check whether the number is a perfect number or not #java