H
Hal Vaughan
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
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