The Object...
takes any non-primitive type and at any number. In Java
it is called variable length argument.
It means you may call the fragmentRequestAction()
method like this -
fragmentRequestAction(fragment, 345); //no object here
fragmentRequestAction(fragment, 345, someObj);
fragmentRequestAction(fragment, 345, someObj1, someObj2);
fragmentRequestAction(fragment, 345, someObj1, someObj2, someObj3);
Variable length argument intruded from java 5. There is some rules to remember while constructing function with variable length arguments. See the code snippet -
public void meth ( int... a) // valid
public void meth (double a, int... b) // valid
public void meth ( int... a, int b) // invalid- Ellipsis may be used towards the end only
public void meth ( int... a, double... b) // invalid - More than one variable length parameter list may not be used
public void meth ( Student... a) // valid - Reference types are also allowed
public void meth( int[]... a) // valid - reference types are also allowed
Visit the link for more details.