I'm new to Java and am working through some problems. I'm stuck on a question that asks me to "Write a program to input ten words and then display the words that are first and last in alphabetical order". The question is ambiguous. It could mean put all the input words into alphabetical order and display the first and last of these (harder) or display the first and last inputted word in alphabetical order (easier). I wrote the following code:I'm new to Java and am working through some pro