Write the code for a public static method named writeEvenNum…

Questions

Write the cоde fоr а public stаtic methоd nаmed writeEvenNumbers. The method takes a File (outFile) and an int (max) and writes all even numbers 2 through max (inclusive) to the file, one per line. If max is less than 2, write nothing. The method should: Declare but NOT handle any checked exceptions (let them propagate). Use PrintWriter to write to the file. Close the PrintWriter before the method returns under all circumstances. You do not need to write import statements or wrap your method in a class.   Canvas Tip for all Qs: Click on the dropdown that says "Paragraph" and switch to "Preformatted" to get a monospaced font - this can help in coding answers