Jio interview question

Why we use methods in java?