Beruflich Dokumente
Kultur Dokumente
(2)
1. Assume you are designing an application that keeps track of only directors. The
following is a summary of the application. The Person class has been created with the
following attributes: age, name, surname and address. A director will be associated to a
company but can only be a director up to a certain age. Which of the following attributes
are appropriate to include in the Director class?
1. directors name
2. age
3. company name
4. spouse
5. none of the above
4. In an online application you have a code that will be executed when ejbActivate() and
ejbPassivate() are called. The code is used to perform basic house keeping tasks. You
need to know when the code will execute so which of the following statements are true?
5. What is the difference between Stateful Session beans and Entity beans?
6. SOAP messages must contain just one header element. Select one option:
A. True
B. False
7. What of the following is the most suitable for storing data that must not repeat and
searching is not a priority?
1. List
2. Map
3. Vector
4. ArrayList
5. Set
6. HashMap
A. Outer join
B. Self join
C. Equijoin
D. Non-equijoin
class ValHold{
public int i = 10;
}
public class ObParm{
public static void main(String argv[]){
ObParm o = new ObParm();
o.amethod();
}
public void amethod(){
int i = 99;
ValHold v = new ValHold();
v.i=30;
another(v,i);
System.out.println(v.i);
}//End of amethod
1) 10,0,30
2) 20,0,30
3) 20,99,30
4) 10,0,20
Answers (2)
1. Answer 3 is correct.
The company name is the only attribute that is appropriate to include in the Director
class. The name and the age of the director can be stored in the Person class. The spouse
was not a requirement; if this was a requirement then it would be appropriate to change
the design of the Person class to include this.
2. Answer 3 is correct.
The compilation fails because the run() method that is defined by the Runnable interface
is not implemented.
3. Answer 1 is the correct answer because when both the String and Object argument
constructors are considered by the compiler for eligibility, the compiler will choose the
'Most specific method' - which in this case is the String version.
The most specific method is defined as the method which can on invocation,
call the other method without a compile time error. Therefore since the String version can
in turn call the Object version but not the other way round, the String version is used.
7. Choice 5 (Set)
8. Choice D (To control the arrangement of components within the display area of a
container )
9. Choice C (Equijoin)