Login with  Log in with facebook
Hiring Manager? SIGN UP HERE
3

what are the different ways to traverse a HashMap.

Rishi Yadav
08/05/2011 at 20:56
1 Answer
1
1

def list = []               // Default is ArrayList
def list = [] as ArrayList
ArrayList list = []

And again, for HashMap:

HashMap map = [:]
def map = [:] as HashMap

The default in this case is a LinkedHashMap:

def map = [:]

Maneshwar Meel
09/14/2011 at 22:00

If you want to post any answer to this forum then you need to log in.
Schedule a Demo

Schedule a Demo with us

Name *
Email *
Phone *
Company *
Details