Hi, I have this exercise and kinda confuses me...I needed some help from professionals to clear things up for me(this is a school project, we haven't finished the course yet, so maybe some of the expressions we haven't even covered yet... since I'm on spring break, I can't ask my teacher about it, but need to do it now, so will appreciate any help)
I'm not sure if I have to ask for it here, since you didn't make the problem, but you probably have some ideas...share those ideas
Finding the largest object
Write a method that returns the largest objects in an array of objects. The method
public static Object max( Comparable a)
All objects are instance of the Comparable interface. The order of objects in array is determined using compareTo method.
Write a test program( Deriver) that creates array of ten Strings, MRects and Dates, and find the largest String, MRect and Date in the array.
first of all, what kind of object are we talking about?! is it Strings, Integers?! Or should I write a method that covers all types of objects?
in this line: public static Object max( Comparable a)
what is Object(does it mean String, Int...), and what does Comparable refer to?!
"The order of objects in array is determined using compareTo method." what good is this line for?
what is a test program or deriver as he says?!
what is MRects?