Question: Java. I need a method (show below which is called unique) that returns the highest 10 even numbers in the list that are different. 2nd

Java. I need a method (show below which is called unique) that returns the highest 10 even numbers in the list that are different. 2nd image is example file (file has about 500 numbers) numbers.csv Using the method the the output ill have is Top ten unique even numbers : #, #, #, #, #, #, #, #, #, #. Thanks.

Java. I need a method (show below which is called unique) that

returns the highest 10 even numbers in the list that are different.

3 9 1+ import java.util. 5 6 class Num 7 { 80 public static List readFile(ServletContext context, String filename) { List contents new ArrayList(); 10 try { 11 InputStream is = context.getResourceAsStream(filename); 12 if (is != null) { 13 InputStreamReader isr = new InputStreamReader(is); 14 BufferedReader reader = new BufferedReader(isr); 15 String text; 16 while ((text = reader.readLine()) != null) { 17 contents.add(text); 18 } 19 } 20 } catch (Exception e) { 21 e.printStackTrace(); 22 } 23 return contents; 24 } 25 public static List unique(List content) 27 { 28 29 30 return null; 31 } 32 } 260 A B 1 2 3 4. 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 70116 48116 8014 99501 45011 44805 60632 95111 57105 21224 19443 11953 90034 44023 78045 85013 37110 53207 48180 61109 19014 95111 75062 12204 8846 54481 66218 21601 10011 77301 43215 88011 7660 8812 10025 70002 10011 93012 78204 67410 97754 66204 99708 33196 99712 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 3 9 1+ import java.util. 5 6 class Num 7 { 80 public static List readFile(ServletContext context, String filename) { List contents new ArrayList(); 10 try { 11 InputStream is = context.getResourceAsStream(filename); 12 if (is != null) { 13 InputStreamReader isr = new InputStreamReader(is); 14 BufferedReader reader = new BufferedReader(isr); 15 String text; 16 while ((text = reader.readLine()) != null) { 17 contents.add(text); 18 } 19 } 20 } catch (Exception e) { 21 e.printStackTrace(); 22 } 23 return contents; 24 } 25 public static List unique(List content) 27 { 28 29 30 return null; 31 } 32 } 260 A B 1 2 3 4. 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 70116 48116 8014 99501 45011 44805 60632 95111 57105 21224 19443 11953 90034 44023 78045 85013 37110 53207 48180 61109 19014 95111 75062 12204 8846 54481 66218 21601 10011 77301 43215 88011 7660 8812 10025 70002 10011 93012 78204 67410 97754 66204 99708 33196 99712 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!