Re: Problem with Widcards
- From: IchBin <weconsul@xxxxxxx>
- Date: Mon, 27 Feb 2006 10:51:48 -0500
astyskin@xxxxxxxxx wrote:
I cannot understand the error.
Test.java:24: test(java.util.Map<java.lang.Long,java.util.List<?>>) in
Test cannot be applied to
(java.util.Map<java.lang.Long,java.util.List<java.lang.Double>>)
test(map);
^
1 error
What am I doing wrong?
As an example here is a code:
import java.util.*;
public class Test {
static void test(Map<Long, List<?>> map) {
static void test(Map<Long, List<Double>> map) {
for(Long id : map.keySet()) {
System.out.println(id);
for(Object obj : map.get(id)) {
System.out.println(obj);
}
}
}
public static void main(String[] args) {
Map<Long, List<Double>> map = new TreeMap<Long, List<Double>>();
for(long i = 1; i < 5; i++) {
List<Double> array = new ArrayList<Double>();
for(int j=3; j < 6; j++) {
array.add((double)i*j);
array.add( new Double( i * j));
}
map.put(i, array);
}
test(map); }
}
--
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
.
- References:
- Problem with Widcards
- From: astyskin
- Problem with Widcards
- Prev by Date: Re: Automate authentication of a web-site through HTTPUrlConnection
- Next by Date: Re: Some help needed
- Previous by thread: Problem with Widcards
- Next by thread: hyperlink in applet
- Index(es):
Relevant Pages
|