IDL Constructed Types   «Prev  Next»

IDL-to-Java mapping for structs - Quiz

Each question is worth one point. Select the best answer or answers for each question.
 
1. Running IDL containing a struct called Foo through the IDL compiler will generate what set of corresponding Java files ?
Please select the best answer.
  A. FooHelper.java, FooHolder.java, and FooStruct.java
  B. FooStruct.java
  C. FooHolder.java, Foo.java, and FooHolder.java

2. The struct in the following IDL will result in which of the following possible Java files?
module Module4
{
 struct Bar
 {
  string name;
  long height;
 };
};

Please select the best answer.
  A.
package Module4;
public final class Bar
 implements org.omg.CORBA.portable.IDLEntity
{
 private java.lang.String name;
 private int height;
 public Bar(){}
 public Bar(java.lang.String name, int height)
 {
  this.name = name;
  this.height = height;
 }
}
  B.
package Module4;
public final class Bar
 implements org.omg.CORBA.portable.IDLEntity
{
 public java.lang.String name;
 public int height;
 public Bar(){}
 public Bar(java.lang.String name, int height)
 {
  this.name = name;
  this.height = height;
 }
}
  C.
package Module4;
public final class Bar
 implements org.omg.CORBA.portable.IDLEntity
{
 public java.lang.String name;
 public long height;
 public Bar(){}
 public Bar(java.lang.String name, long height)
 {
  this.name = name;
  this.height = height;
 }
}

3. The struct in the following IDL will result in which of the following possible Java files?
module Module4
{
 struct Temperature
 {
  string units;
  double val;
 };
}; 

Please select the best answer.
  A.
package Module4;
public final class Temperature
 implements org.omg.CORBA.portable.IDLEntity
{
 public java.lang.String units;
 public double val;
 public Temperature(){}
 public Temperature(java.lang.String units, double val)
 {
  this.units = units;
  this.val = val;
 }
}
  B.
package Module4;
public class Temperature
 implements org.omg.CORBA.portable.IDLEntity
{
 public java.lang.String units;
 public double val;
 public Temperature(){}
 public Temperature(java.lang.String units, double val)
 {
  this.units = units;
  this.val = val;
 }
}
  C.
package Module4;
public final class Temperature
 implements org.omg.CORBA.portable.IDLEntity
{
 public java.lang.String units;
 public double val;
 public Temperature(java.lang.String units, double val)
 {
  this.units = units;
  this.val = val;
 }
}

Correct answers:

Your Score: 0