Skip to content

Swordpro3001/GenericsTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Write a class GenericUtils with a class method called reverse that takes an array of a generic type as a parameter. The method should flip this array (so that the first element is at the last and the last element first). The swapping should happen in-place, so no new array should be created.

Write a second class method Generic method called sum that takes an array of a generic type as a parameter. But in this instance the allowed types for this array should only be subclasses of the java.lang.Number-class (including java.lang.Number). Calculate the sum of all values in the Array and return the result as double.

Write a class with a main method, which tests the methods of the GenericUtilsclass.

Pay particular attention to: Use English identifiers (aka names), write your comments in English and be prepared to make your assignment talk in English as well.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages