The future belongs to those who believe in the beauty of their dreams.Dream BIG!
The future belongs to those who believe in the beauty of their dreams.Dream BIG!
SCJP 1.5 94%.
The greatest glory in living lies not in never falling, but in rising every time we fall.
The future belongs to those who believe in the beauty of their dreams.Dream BIG!
Originally posted by Nabila Mohammad:
A. public static <E extends CharSequence> Collection<? extends CharSequence> getLongWords(Collection<E> coll)
What is <E extends CharSequence> here?
Is it the return type?
If it is the return type then what is B]Collection<? extends CharSequence>[/B].I thought it meant the return type is of "Collection" which is of "? extends CharSequence" type.
In that case what doese <E extends CharSequence> before the Collection <............> mean.
They both look like return types to me , so how can they be placed together?
Can some one pleas help me to figure this out![]()
The future belongs to those who believe in the beauty of their dreams.Dream BIG!
Originally posted by Nabila Mohammad:
A. public static <E extends CharSequence> Collection<? extends CharSequence> getLongWords(Collection<E> coll)
What is <E extends CharSequence> here?
Is it the return type?
If it is the return type then what is B]Collection<? extends CharSequence>[/B].I thought it meant the return type is of "Collection" which is of "? extends CharSequence" type.
In that case what doese <E extends CharSequence> before the Collection <............> mean.
They both look like return types to me , so how can they be placed together?
Can some one pleas help me to figure this out![]()
SCJP 6 83%
Working on SCWCD/OCPJWCD
The future belongs to those who believe in the beauty of their dreams.Dream BIG!
SCJP 6 83%
Working on SCWCD/OCPJWCD
The future belongs to those who believe in the beauty of their dreams.Dream BIG!
Originally posted by Sumit Bisht:
public static <E extends CharSequence> Collection<? extends CharSequence> getLongWords(Collection<E> coll)
See, if you are looking for the generic type of the return type, look after the return type. After closely looking the method declaration, you'll see that a Collection object is returned(of the wildcard type that is a/is a subclass of CharSequence(like String).), but before that, the <E extends CharSequence> stands for the 'E type' parameter that is used in the method.
For your query about access specifier, I would recommend that you read the K&B section about them as they are explained in a lucid manner.
The future belongs to those who believe in the beauty of their dreams.Dream BIG!
The future belongs to those who believe in the beauty of their dreams.Dream BIG!
Beauty is in the eye of the tiny ad.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|