You have a test for
number > 0 inside a loop
while (number > 1). I hardly think that test is necessary.
I have been teaching undergraduates today and I been telling them off for using the wrong hardware. Then I showed them a pencil and a large eraser, which I think is the equipment you ought to use now, too
Take a number, any number, well 6, take a divisor, any divisor, well 2, and work out what
number % (number / divisor) will come to. Can you concoct a simpler test which will work?
Now work out what the test after the else if does. What would happen if you simplify that test? Does that second test do anything useful at all?
Lose the bit about
if (number == 1)
Move the
System.out.println() call after the end of your loop.