3. |
Which of the following Java code fragments represents correct possible client code for the ClubBouncer interface in the following IDL?
module Module4
{
//Sequence of names
typedef sequence<string> NameList;
interface ClubBouncer
{
//Takes list of names, pushes back out with un-hip names removed
void approvePeople(inout NameList clubGoers);
};
};
Please select the best answer.
|
|
A. |
//Initialize ORB ..
ClubBouncer bouncer = null;
//Obtain reference to remote ClubBouncer ..
String[] wannabes = {"Mark", "Gordon", "Madonna"};
bouncer.approvePeople(wannabes);
System.out.println("They'll only let in
"+wannabes.length+" of us");
// ...
|
|
B. |
//Initialize ORB ..
ClubBouncer bouncer = null;
//Obtain reference to remote ClubBouncer ..
String[] wannabes = {"Mark", "Gordon", "Madonna"};
NameListHolder listParam = new NameListHolder(wannabes);
bouncer.approvePeople(listParam);
System.out.println("They'll only let in
"+listParam.value.length+" of us");
// ...
|
|
C. |
//Initialize ORB ..
ClubBouncer bouncer = null;
//Obtain reference to remote ClubBouncer ..
NameList wannabes = new NameList("Mark", "Gordon", "Madonna");
NameListHolder listParam = new NameListHolder(wannabes);
bouncer.approvePeople(listParam);
System.out.println("They'll only let in
"+listParam.value.length+" of us");
// ...
|