Copying the same logic in three places means fixing the same bug three times. A method takes inputs through parameters and hands back one result with return, so you write the logic once. Pull out a method when a block has one clear job, like isPrime(n) or gcd(a, b). Use void when the method only does something, like printing, and returns nothing.