Salemikael Kebede

+ Follow
since Jun 25, 2018
Salemikael likes ...
Java MySQL Database Oracle
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Salemikael Kebede

Rob Spoor wrote:Campbell is right. Both of your methods have a generic argument T.

One of the method has T and the other T[] as argument/parameter.

Rob Spoor wrote:When you use JenericMethod.<String[]>ship, you use String[] for T, not for T[] - because the generic type is not T[] but T.

I don't think it is possible to declare generic type as T[], And JenericMethod.<String>ship calls the overloaded array method while the generic type is T.  The confusing thing for me is that when I use JenericMethod.<String>ship to call the method, the compiler identifies correctly which method to call based on the argument.

As you can see in the image below, the IDE also identifies the correct/ my assumption/  method using the argument type.
Hello Guys,

I'm Confused with specifically calling Generic Method. If we call generic method like JenericMethod.<String[]>ship(argument1), it is suppose to call the method that its parameter is array. However in this case, it is calling the overloaded function that doesn't have Array as a parameter. What am I missing here?

Hello Rami,

Sometimes our understanding depends on the way things are explained to us. Try Jeanne and Scott's book. I highly recommend it since i used only this book to pass the exam 4 months ago.
Go through the book at least two times before taking the mock exam. Definitely you will see improved result.

Salemikael A.