IN JAVA
Write a MAIN METHOD that asks for user input of a positiveinteger and a negative integer validates the inputs using a loopand then calls the METHOD from Question 3 and prints the result.The MAIN should have two variables (appropriately typed), get theinput from the user and store them in the variables aftervalidating them, then call the method from question 3 (sendingparameters, if necessary) and print the returned value with anappropriate descriptive statement.
// Question 3
/*
public static int sum(int num1, int num2){
int both;
both = num1 + num2;
return both;
}
*/