Which code segment should you choose?

You create Web-based client applications. You create a class library that is named Fabrikam.dll. Ten applications will use Fabrikam.dll. Fabrikam.dll contains two classes that are named Order and OrderDetail. The class library must meet the following requirements:

Both the classes in Fabrikam.dll are available to client applications of Fabrikam.dll. Each instance of the OrderDetail class is associated with an instance of the Order class. Code segments in client applications do not instantiate the OrderDetail class.
The OrderDetail class contains no static members.

You need to design the interface for the OrderDetail class. Which code segment should you choose?

You create Web-based client applications. You create a class library that is named Fabrikam.dll. Ten applications will use Fabrikam.dll. Fabrikam.dll contains two classes that are named Order and OrderDetail. The class library must meet the following requirements:

Both the classes in Fabrikam.dll are available to client applications of Fabrikam.dll. Each instance of the OrderDetail class is associated with an instance of the Order class. Code segments in client applications do not instantiate the OrderDetail class.
The OrderDetail class contains no static members.

You need to design the interface for the OrderDetail class. Which code segment should you choose?

A.
public sealed class OrderDetail {
internal OrderDetail(){

}
}

B.
internal sealed class OrderDetail {
internal OrderDetail() {

}
}

C.
public sealed class OrderDetail {
public OrderDetail() {

}
}

D.
public sealed class OrderDetail {
private OrderDetail() {

}
}



Leave a Reply 0

Your email address will not be published. Required fields are marked *