Creating a HashMap and Passing It As a Parameter in One Step
- From: Hal Vaughan <hal@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 28 Sep 2006 01:37:31 -0400
I don't know what this is called, but I know if I have a method like this:
public void setValues(String[] newValues) {
//Do a bunch of stuff
return;
}
That I can call it by building a String[] within the line that calls it,
like this:
setValues(new String[] {firstString, secondString, thirdString});
First, is there a name for creating an object like this just to pass as a
parameter?
Second, is there a way I can create a HashMap the same way, with just one
line, specifying 2-3 keys and their values?
Thanks!
Hal
.
- Follow-Ups:
- Re: Creating a HashMap and Passing It As a Parameter in One Step
- From: Doug Pardee
- Re: Creating a HashMap and Passing It As a Parameter in One Step
- From: Mike Schilling
- Re: Creating a HashMap and Passing It As a Parameter in One Step
- From: Michael Rauscher
- Re: Creating a HashMap and Passing It As a Parameter in One Step
- From: Karl Uppiano
- Re: Creating a HashMap and Passing It As a Parameter in One Step
- Prev by Date: How to dynamically manage the properties of an editpart in GEF?
- Next by Date: Re: Combobox how to disable edit but allow select
- Previous by thread: How to dynamically manage the properties of an editpart in GEF?
- Next by thread: Re: Creating a HashMap and Passing It As a Parameter in One Step
- Index(es):
Relevant Pages
|
|