What is the correct answer?


Consider the following class definitions:
 class maths { 
student student1;
class student {
String name;

This code represents:

A. an 'is a' relationship

B. a 'has a' relationship

C. both

D. neither

Correct Answer :

B. a 'has a' relationship

Related Questions

For all insert, update, delete, query operations on a database, ResultSet… A variable declared inside the for loop control can not be referenced… The default case is always required in the switch selection structure. DataInput is A package is a collection of A thread can make second thread ineligible for execution by calling the… Which of the following are not keywords? A constructor must always invoke its supper class constructor in its first… Two methods cannot have the same name in Java. If a=10 and b= 15, then the statement x =(a>b)?a:b; assigns the value… Java always provides a default constructor to a class. When X is a positive number the operations x>> 2 and x>>>2… Objects are passed to a method by use of call-by-reference. Which of the following methods belong to the String class? A method declared as static can not access non-static class members. Throwing an exception always causes program termination. Declaring a method synchronized guarantees that the deadlock cannot occur. What is error in the following class definitions? abstract class… Any method in a supper class can be over ridden in its subclass. The concept of multiple inheritance is implemented in Java by EJBs can be of the following type(s)None of the above Which of the following represent legal flow control statements? The break statement is required in the default case of a switch selection… Members of a class specified as private are accessible only to the methods… Which of the following statements are valid array declarations? A static class method can be invoked by simply using the name of the method… All methods in an abstract class must be declared abstract. Session bean The import statement is always the first no comment statement in a Java… The name of a Java program file must match the name of the class with…