Link to home
Start Free TrialLog in
Avatar of vlg
vlg

asked on

Java 1.5 Syntax help

Hello all,

What's the correct syntax for the declaration of:

1)  A public function (named "Fred")  that returns a double, and takes, as it's only argument, a Vector ((called "ethel") of Hashtables, where the hash key is a long, and the hash value is a Double?  I want to use the new generics, and I can't get this to work in Eclipse:

public double Fred(Vector<Hashtable<Long(), Double()>> ethel) { method body here}

2)  A foreach loop which loops through each hashtable in the vector "ethel" above, something like:

for (Hashtable<Long(), Double()> myHash: ethel) { stuff with myHash here}


Thanks!
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry - don't get confused between the function variable name and h.values() ;-)
This would have been better as an illustration:

// Print the entries:

System.out.println(h.entrySet());
:-)