Ôn thi tốt nghiệp: java + uml ( in oop (using java) subject ) Question 1



tải về 0.89 Mb.
trang6/8
Chuyển đổi dữ liệu30.08.2016
Kích0.89 Mb.
1   2   3   4   5   6   7   8

Question 296–d

What package contains the String class?



  1. java.awt

  2. java.util

  3. java.text

  4. java.lang

Question 297–c

What restrictions are placed on the location of a package statement within a source code file?



  1. A package statement must appear as a comment somewhere in the source code file.

  2. A package statement must appear as the last line in a source code file.

  3. A package statement must appear as the first line in a source code file.

Question 298–d

What results from running the following code?

1. public class Short {

2. public static void main(String args[]) {

3. StringBuffer s = new StringBuffer("Hello");

4. if ((s.length() > 5) &

5. (s.append(" there").equals("False")))

6. ; // do nothing

7. System.out.println("value is " + s);

8. }


9. }

  1. A NullPointerException

  2. The output: value is Hello there

  3. No output

  4. The output: value is Hello

  5. A compiler error at line 4 or 5

Question 299–c

What statement can you use to refer to the methods and variables of a superclass?



  1. this

  2. call

  3. super

Question 300–cd

What two statements are true about properly overridden hashCode() and equals() methods?



  1. equals() doesn’t have to be overridden if hashCode() is.

  2. If two different objects that are not meaningfully equivalent both invoke hashCode(), then hashCode() can’t return the same value for both invocations.

  3. hashCode() can always return the same value, regardless of the object that invoked it.

  4. equals() can be true even if it’s comparing different objects.

  5. hashCode() doesn’t have to be overridden if equals() is.

Question 301–d

What will be output after the following Java statements have been executed?

int a, b, c, d;

a = 4;


b = 12;

c = 37;


d = 51;

if ( a < b )

System.out.println( "a < b" );

if ( a > b )

System.out.println( "a > b" );

if ( d <= c )

System.out.println( "d <= c" );

if ( c != d )

System.out.println( "c != d" );

a) a < b


c < d

a != b


b) a < b

d <= c


c != d

c) a > b

c != d

d) a < b


c != d

Question 302–b

What will be printed out if you aft empt to compile and run the following code?

int i=9;

switch (i) {

default:

System.out.println(""""default"""");

case 0:

System.out.println(""""zero"""");

break;

case 1:


System.out.println(""""one"""");

case 2:


System.out.println(""""two"""");

}


  1. one, two

  2. default, zero

  3. none of them

  4. default, one

Question 303–d

What will be the output from the following code?

class Galax {

String str = "Galax";

public void ameth(String str){

System.out.println("Galax = "+str);

}}

class Sun extends Galax{



String str = "Sun";

public void ameth(String str){

System.out.println("Sun = "+str);

}}

class Planet extends Sun{



String str = "Planet";

public void ameth(String str){

System.out.println("Planet = "+str);

}}

public class OOP4{



public static void main(String args[]) {

Planet P = new Planet();

Galax G1 = (Sun)P;

G1.ameth(G1.str);

}}


  1. Galax = Galax

  2. Planet = Planet

  3. Galax = Sun

  4. Planet = Galax

  5. Sun = Sun

Question 304–b

What will be the output from the following code?

class Misc1 {

int x =5, y=3, z=8;

public static void main(String args[]){

Misc1 M1 = new Misc1();

M1.Normal();

}

void Normal()



{

System.out.print( " ( " + x + ", " + y + ", " + z + " ) " );

swap( x, y );

System.out.print( " ( " + x + ", " + y + ", " + z + " ) " );

}

void swap( int x, int y )



{ int temp;

temp = x;

x = y;

y = temp;



z=100;

System.out.print( " ( " + x + ", " + y + ", " + z + " ) " );

}

}


  1. (5, 3, 8) (3, 5, 8) (5, 3, 100)

  2. (5, 3, 8) (3, 5, 100) (5, 3, 100)

  3. (5, 3, 8) (5, 3, 8) (5, 3, 8)

  4. (5, 3, 8) (3, 5, 8) (3, 5, 100)

  5. (5, 3, 8) (3, 5, 100) (5, 3, 8)

Question 305–e

What will be the output from the following code?

class Top { public String variable = "Top"; }

class Middle extends Top {

protected String variable = "Mid";

protected void LOS(int dist){

double range = 6.0,

double Loss = range * dist;

System.out.println(variable + ": " + Loss);

}}

class Bottom extends Middle {



private String variable = "Bot";

public void LOS(int dist){

double range = 9.0,

double Loss = range * dist;

System.out.println(variable + ": " + Loss);

}}

public class OOP9 {



public static void main(String args[]){

Top topRef1 = new Middle();

Middle midRef1 = new Bottom();

topRef1.LOS(4);

midRef1.LOS(4);

System.out.println(topRef1.variable);

System.out.println(midRef1.variable);

}}


  1. Mid:24, Bot:36, Mid, Bot

  2. null, Mid:24, Top, Bot

  3. Mid:24, Bot:36, Top, Mid

  4. Bot:36, Top, Mid

  5. Compiler error

Question 306–a

What will be the output of the following program?

class B{

public static void main(String s[]){

int x = 1;

B t = new B();

System.out.print(x);

t.modify(x);

System.out.print(x);

}

void modify(int n){



n = n+1;

}

}



  1. 11

  2. 13

  3. 12

  4. 10

Question 307–a

What will be the output of the following program?

class B{

public static void main(String s[]){

String java = "Java", va = "va";

System.out.print(java == "java");

System.out.print(java == "Ja"+"va");

System.out.print(java == "Ja"+va);

System.out.print(java.equals("Ja"+va));

}

}



  1. falsetruefalsetrue

  2. falsefalsetruetrue

  3. truefalsetruefalse

  4. truetruefalsefalse

Question 308–d

What will be the output of the following program?

class K{

static int users = 0;

public static void main(String s[]){

System.out.print(++users);

System.out.print(users++);

}

}



  1. 10

  2. 00

  3. 01

  4. 11

Question 309–b

What will be the result of attempting to compile and run the following code?

abstract class MineBase

abstract void amethodQ;

static int i;

}

public class Mine extends MineBase



public static void main(String argv[]) {

int[] ar=new int[5];

for(i=0;i < ar.length;i++)

System.out.println(ar[i]);

}

}


  1. a sequence of 5 0's will be printed

  2. Error Mine must be declared abstract

  3. IndexOutOfl3oundes Error

  4. Error: ar is used before it is initialized

Question 310–a

What will be the result of attempting to compile and run the following program?

public class MyClass extends Thread {

public MyClass(String s) { msg = s; }

String msg;

public void run() {

System.out.println(msg);

}

public static void main(String[] args) {



new MyClass("Hello");

new MyClass("World");

}

}

Select the one correct answer



  1. The program will compile without errors and will simply terminate without any output when run.

  2. The program will compile without errors and will print Hello and World, in that order, every time the program is run.

  3. The program will fail to compile.

  4. The program will compile without errors and will print a never-ending stream of Hello and World.

  5. The program will compile without errors and will print Hello and World when run, but the order is unpredictable.

Question 311–b

What will be the result when you attempt to compile and run the following code?.

public class Conv{

public static void main(String argv[]) {

Cony c=new ConvQ;

String s=new String("ello");

c.amethod(s);

}

public void amethod(String



char c='H'

c+=s;


System.out.println(c);

}

}



  1. Compilation and output the string elloH

  2. Compile time error

  3. Compilation and output the string "Hello"

  4. Compilation and output the string "ello"

Question 312–a

What will be the result when you attempt to compile this program?

public class Rand{

public static void main(String argv[]) {

int iRand;

iRand =Math.random();

System.out.println(iRand);

}

}



  1. Compile time error referring to a cast problem

  2. A random number between 1 and 10

  3. A compile time error about random being an unrecognised method

  4. A random number between 0 and 1

Question 313–d

What will be the result when you try to compile and run the following code?

private class Base{

Base(){


int i= 100;

System.out.println(i);

}

}

public class Pri extends Base{



static int i = 200;

public static void main(String argv[]) {

Pri p = new Pri();

System.out.println(i);

}

}


  1. 200

  2. 100

  3. 100 followed by 200

  4. Error at compile time

Question 314–a

What will happen if you attempt to compile and run the following code?

class Base {}

class Sub extends Base {}

class Sub2 extends Base {}

public class CEx{

public static void main(String argv[]) {

Base b=new Base();

Sub s=(Sub) b;

}

}



  1. Runtime Exception

  2. Compile time Exception

  3. Compile and run without error

Question 315–d

What will happen if you attempt to compile and run the following code?

Integer ten=new Integer(10);

Long nine=new Long (9);

System.out.println(ten + nine);

int i= 1;

System.out.println(i + ten);


  1. 19 followed by 11

  2. 19 followed by 20

  3. 10 followed by 1

  4. Error: Can't convert java lang Integer

Question 316–a

What will happen when you attempt to compile and run the following code?

class Background implements Runnable {

int i=0;

public int run(){

while(true) {

System.out.println()'i="+i);

} //End while

}//End run

}//End class



  1. The code will cause an error at compile time.

  2. Compilation will cause an error because while cannot take a parameter of true.

  3. It will compile and the run method will print out the increasing value of i.

  4. It will compile and calling start will print out the increasing value of i.

Question 317–c

What will happen when you attempt to compile and run the following code?

import java.util.*;

public class Stage{

public static void main(String argv[]){

LinkedHashSet lhs = new LinkedHashSet();

lhs.add("one");

lhs.add("two");

lhs.add("One");

lhs.add("one");

Iterator it = lhs.iterator();

while(it.hasNext()){

System.out.print(it.next());

}

}



}

  1. Compilation and output of onetwoOneone

  2. Compilation and output of every element added

  3. Compilation and output of onetwoOne

  4. Compilation and output of oneOnetwoone

  5. Compile-time error; LinkedHashMap has no add method

Question 318–d

What will happen when you compile and run the following code?

public class Scope{

private int i;

public static void main(String argv[]) {

Scope s = new Scope();

s.amethod();

}//End of main

public static void amethod(){

System.out.println(i);

}//end of amethod

}//End of class



  1. A value of 0 will be printed out

  2. A compile time error complaining of the scope of the variable i

  3. Nothing will be printed out

  4. A compile time error

Question 319–a

What will happen when you attempt to compile and run this code?

//Demonstration of event handling

import java.awt.event.*;

import java.awt.*;

public class MyWc extends Frame implements WindowListener{

public static void main(String argv[]){

MyWc mwc = new MyWc();

}

public void windowClosing(WindowEvent we){



System.exit(0);

}//End of windowClosing

public void MyWc(){

setSize(300,300);

setVisible(true);

}

}//End of classÿÿ



  1. Error at compile time

  2. Compilation but no output at run time

  3. Visible Frame created that that can be closed

  4. Error at compile time because of comment before import statements

Question 320–c

What will happen when you invoke the following method?

1 void infiniteLoop()

2 {


3 byte b = 1;

4

5 while ( ++b > 0 )



6 ;

7 System.out.println("Welcome to Java");

8 }


  1. The loop never ends(infiniteLoop)

  2. Prints nothing

  3. Prints "Welcome to Java"

  4. Compilation error at line 5. ++ operator should not be used for byte type variables

Question 321

What will happen when you try compiling and running this code?

public class Ref {

public static void main(String argv[]) {

Ref r = new RefQ;

r.amethod(r);

}

public void amethod(Refr) {



int i=99;

multi(r);

System.out.println(i);

}

public void multi(Refr) {



r.i = r.i*2;

}

}



  1. An output of 198

  2. Error at compile time

  3. An error at runtime

  4. An output of 99

Question 322–d

What will the following code do?

private JLabel theLabel = new JLabel("hello");


  1. It defines the JLabel class

  2. A "hello" button will appear on the screen

  3. A "hello" string will appear on the screen

  4. Memory is allocated for a JLabel object with the string "hello", but it will not appear on the screen

Question 323–e

What will the user interface look like in an applet given the following initfl method?

public void init() {

setLayout(new BorderLayout);

add("East", new Button("hello"));

}


  1. A button will appear on the left side of the applet

  2. A button will appear in the applet set in the exact center

  3. Nothing will appear in the applet

  4. A button will fill the entire applet

  5. A button will appear on the right side of the applet

Question 324–a

What would be the output from this code fragment?

1. int x = 0, y = 4, z = 5;

2. if (x > 2) {

3. if (y < 5) {

4. System.out.println("message one");

5. }

6. else {



7. System.out.println("message two");

8. }


9. }

10. else if (z > 5) {

11. System.out.println("message three");

12. }


13. else {

14. System.out.println("message four");

15. }


  1. message four

  2. message one

  3. message three

  4. message two

Question 325–d

When invoking a method with an object argument, ___________ is passed.



  1. a copy of the object

  2. the contents of the object

  3. the reference of the object

  4. the object is copied, then the reference of the copied object

Question 326–a

When is it most appropriate to create an object-oriented interface?



  1. When several classes share a common behaviour but implement it in different ways.

  2. When one class borrows the behaviour of another.

  3. When several classes have different behaviours.

  4. When several classes implement a common behaviour.

Question 327–d

Where can a protected variable be accessed?



  1. any class

  2. only from the code within any subclass of the class in which it is defined

  3. only from the code within the same class in which it is defined.

  4. both from the code within the same class in which it is defined, and from the code within any subclass of the class in which it is defined.

Question 328–c

Where is com.mysql.jdbc.Driver located?



  1. in the standard Java library bundled with JDK

  2. in a JAR file classes12.jar

  3. in a JAR file mysqljdbc.jar

Question 329–a

Why does the following class have a syntax error?

import java.applet.*;

class Test extends Applet implements Runnable {

public void init() throws InterruptedException {

Thread t = new Thread(this);

t.sleep(1000);

}

public synchronized void run() {



}

}


  1. The sleep() method should be put in the try-catch block. This is the only reason for the compilation failure.

  2. The init() method is defined in the Applet class, and it is overridden incorrectly because it cannot claim exceptions in the subclass.

  3. You cannot put the keyword synchronized in the run() method.

  4. The sleep() method is not invoked correctly; it should be invoked as Thread.sleep(1000).

Question 330–c

Why won't the following class compile?

class A {

private int x;

public static void main(String[] args) {

new B();

}

class B {



B() {

System.out.println(x);

}

}

}



  1. Class B fries to access a private variable defined in its ouer class.

  2. Class B's constructor must be public.

  3. Class A attempts to create an instance of B when there is no current instance of class A.

Question 331–b

You are concerned about that your program may attempt to use more memory than is available. To avoid this situation you want to ensure that the Java Virtual Machine will run its garbage collection just before you start a complex routine. What can you do to be certain that garbage collection will run when you want.



  1. Use the System.gc() method to force garbage collection.

  2. You cannot be certain when garbage collection will run

  3. Ensure that all the variables you require to be garbage collected are set to null

  4. Use the Runtime.gc() method to force garbage collection

Question 332–b

You are creating a class that extends Object and implements Runnable. You have already written a run method for this class. You need a way to create a thread and have it execute the run method.

Which of the following start methods should you use?

a) public void start(){

Thread myT = new Thread(this);

myT.run();

}

b) public void start(){



new Thread( this ).start();

}

c) public void start(){



Thread myT = new Thread();

myT.start();

}

Question 333–b

You are creating an applet with a Frame that contains buttons. You are using the GridBagLayout manager and you have added Four buttons. At the moment the buttons appear in the centre of the frame from left to right. You want them to appear one on top of the other going down the screen. What is the most appropriate way to do this.



  1. Set the fill value of the GridBagLayout class to GridBag.VERTICAL

  2. Set the gridy value of the GridBagConstraint class to a value increasing from 1 to 4

  3. Set the ipady value of the GridBagConstraint class to a value increasing from 0 to 4

  4. Set the fill value of the GridBagConstrint class to VERTICAL

Question 334–bd

You can use the methods in the Collections class to



  1. sort a collection.

  2. find the maximum object in a collection based on the compareTo method.

  3. do a binary search on a collection.

  4. find the maximum object in a collection using a Comparator object.

  5. shuffle a collection.

Question 335–be

You can use the methods in the Collections class to



  1. sort a collection.

  2. find the maximum object in a collection using a Comparator object.

  3. shuffle a collection.

  4. do a binary search on a collection.

  5. find the maximum object in a collection based on the compareTo method.

Question 336–b

You create a hash table, specifying the following initial capacity and load factor in the constructor. What does this mean?

Hashtable(50, 0.50)


  1. If the hash table exceeds its capacity of 50 entries, an exception will be thrown.

  2. When the hash table reaches 25 entries, it will be automatically rehashed into a larger table.

  3. When the hash table reaches its capacity of 50 entries, its capacity will be automatically increased by 50%.

  4. The maximum capacity of the hash table is 75 entries (50 entries plus 50%).

Question 337–b

You have created a TimeOut class as an extension of thread, the purpose of which is to print a "Time's Up" message if the thread is not interrupted within 10 seconds of being started.

Here is the run method that you have coded:

1. public void run(){

2. System.out.println("Start!");

3. try { Thread.sleep(10000 );

4. System.out.println("Time's Up!");

5. }catch(InterruptedException e){

6. System.out.println("Interrupted!");

7. }


8. }

Given that a program creates and starts a TimeOut object, which of the following statements is true?



  1. The delay between "Start!" being printed and "Time's Up!" will be 10 seconds plus or minus one tick of the system clock.

  2. If "Time's Up!" is printed, you can be sure that at least 10 seconds have elapsed since "Start!" was printed.

  3. Exactly 10 seconds after "Start!" is printed, "Time's Up!" will be printed.

  4. Exactly 10 seconds after the start method is called, "Time's Up!" will be printed.

Question 338–b

You have created two objects called Influenza and Polio using the Virus class. Virus contains an object variable called symptom. What happens if you change the value of symptom in the Influenza object?



  1. The value is changed in all three programs

  2. The value is changed only in Influenza

  3. The value is changed in Virus and Influenza

Question 339–c

You have these files in the same directory. What will happen when you attempt to compile and run Class1.java if you have not already compiled Base.java?

//Base.java

package Base;

class Base{

protected void amethod() {

System.out.println("amethod");

}//End of amethod

}//End of class base

package Class1;

//Class1 .java

public class Class1 extends Base{

public static void main(String argv[]) {

Base b = new Base();

Base b = new Base();

b.amethod();

}//End of main

}//End of Class



  1. Compilation followed by the output "amethod"

  2. Compile Error: Unable to access protected method in base class

  3. Compile error: Superclass Class1.Base of class Class1.Class1 not found

  4. Compile Error: Methods in Base not found

Question 340–bd

You have written a class extending Thread that does time-consuming computations. In the first use of this class in an application, the system locked up for extended periods of time. Obviously, you need to provide a chance for other threads to run. The following is the run method that needs to be modified:

1. public void run(){

2. boolean runFlg = true ;

3. while( runFlg ){

4. runFlg = doStuff();

5.

6. }


7. }

Which statements could be inserted at line 5 to allow other threads a chance to run?

[Check all correct answers.]


  1. wait( 100 );

  2. yield();

  3. suspend( 100 );

  4. try{ sleep(100); } catch(InterruptedException e){ }

Question 341–d

You have written an application that can accept orders from multiple sources, each one of which runs in a separate thread. One object in the application is allowed to record orders in a file. This object uses the recordOrder method, which is synchronized to prevent conflict between threads.

While Thread A is executing recordOrder, Threads B, C, and D, in that order, attempt to execute the recordOrder method. What happens when Thread A exits the synchronized method?


  1. Thread B, as the first waiting thread, is allowed to execute the method.

  2. Thread D, as the last waiting thread, is allowed to execute the method.

  3. Either A or D, but never C, will be allowed to execute.

  4. One of the waiting threads will be allowed to execute the method, but you can't be sure which one it will be.

Question 342–d

You want SubClass in any package to have access to method of a SuperClass. Which most restric access modifier that will accomplish this objective?



  1. private

  2. transient

  3. NoAccessModifer

  4. Protected

  5. public

Question 343–c

You want to create and use random number generators in your Java program. Why would you use the Random class instead of using the simpler random() method of the java.lang.math class?



  1. The random() method of java.lang.math was deprecated in JDK.

  2. The math.random() method returns only integer data types.

  3. By using the Random class, you can create multiple random number generators as separate objects.

Question 344–c

You want to lay out a set of buttons horizontally but with more space between the first button and the rest.

You are going to use the GridBagLayout manager to control the way the buttons are set out. How will you modify the way the GridBagLayout acts in order to change the spacing around the first button?


  1. Create an instance of the GridBagConstraints class, call the weightx() method and then pass the GridBagConstraints instance with the component to the setConstraints methodof the GridBagLayout class.

  2. Create an instance of the GridBagLayout class, set the weightx field and then call the setConstraints method of the GridBagLayoutClass with the component as a parameter.

  3. Create an instance of the GridBagConstraints class, set the weightx field and then pass the GridBagConstraints instance with the component to the setConstraints method of the GridBagLayout class.

  4. Create an instance of the GridBagLayout class, call the setWeightx() method and then pass the GridBagConstraints instance with the component to the setConstraints method of the GridBagLayout class.

Question 345–c

You want to reference all the elements in a package without specifying the package name repeatedly throughout your class.

Which statement syntax should you use?


  1. import packageName.interfaceName;

  2. import packageName.className;

  3. import packageName.*;

Question 346–b

You wish to store a small amount of data and make it available for rapid access. You do not have a need for the data to be sorted, uniqueness is not an issue and the data will remain fairly static Which data structure might be most suitable for this requirement?



  1. LinkedList

  2. an array

  3. HashMap

  4. TreeSet


( *** IN UML SUBJECT *** )


Question 347–b

A scenario is a(n)



  1. "includes" use case.

  2. set of use cases.

  3. set of steps within a use case.

  4. single use case.

Question 348-c

A use case diagram is an extension of the



  1. class diagram.

  2. sequence diagram.

  3. context diagram.

  4. event table.

Question 349–abd

A Use Case model should:



  1. Focus on communicating one aspect of a system view.

  2. Provide a dynamic view of behaviour.

  3. Describe all of the implementation specifics of an application.

  4. Identify all of the actors, use cases, and their relationships.

  5. Capture as much design detail as possible.

Question 350–a

Activation Lifeline:



  1. The vertical narrow rectangle to emphasize that an object is only active during part of a scenario for a sequence diagram.

  2. Messages

  3. The vertical line under an object on a sequence diagram to show the passage of time for the object.

Question 351–a

Actor:


  1. A role played by an external user of the system.

  2. Scenarios

  3. A single use or function performed by the system for those who use the system

Question 352–d

Any person who has an interest in existing or new information systems is known as



  1. A network manager

  2. A stockholder

  3. None of the other answers

  4. A stakeholder

  5. An end-user

Question 353–ad

At Conceptual level, a Class can consist attributes of:

(choose 2)


  1. Primitive data type

  2. All of the other answers

  3. Complex data type e.g. Customer, Account, Inventory

  4. Value object data type e.g. Date, Money

Question 354–a

Class diagrams at conceptual level should include:



  1. attributes ONLY

  2. both attributes and operations

  3. operations ONLY

Question 355–a

Collaboration Diagram :



  1. Primary use is to quickly get an overview of all the objects that collaborate to support a given scenario

  2. A relationship between two objects rather than between object classes

  3. A condition of being for an object; part of a statechart

  4. The condition of being in more than on state at a time within a statechart

  5. A high-level state that has other states nested within it

  6. An activity performed by an object in a particular state

Question 356–e

Consider the following activity diagram.

Identify the activities that can occur concurrently?



  1. All activities can occur concurrently.

  2. Pay bill, Close order.

  3. Process order, Pull materials, Ship order, Bill customer, Pay bill.

  4. Request product, Receive order, Pay bill.

  5. Receive order, Bill customer.

Question 357–c

Consider the following expression tree (left and right orientation reflect left/right child relationships).

What is printed out by a post-order traversal of this tree?



  1. C E + D / A ++ -- *

  2. C E ++ D / A * -- +

  3. C D E + / A ++ -- *

  4. * -- + C E ++ D / A

  5. * -- + C E D / A ++

Question 358–b

Consider the following statements.

(C) In order for one class to send a message to another on a sequence diagram or collaboration diagram, there must be a relationship between the two classes.

(H) Associations in class diagrams are always bi-directional.

(Y) In UML, bi-directional associations are drawn either with arrowheads at both ends or without arrowheads at all.

Which of the above statements is/are correct?



  1. Only (Y)

  2. Only (C) and (Y)

  3. Only (C) and (H)

  4. Only (C)

  5. Only (H) and (Y)

Question 359–c

Consider the following statements.

(N) In order for one class to send a message to another on a sequence diagram or collaboration diagram, there must be a relationship between the two classes.

(E) Associations in class diagrams are always bi-directional.

(Q) In UML, bi-directional associations are drawn either with arrowheads at both ends or without arrowheads at all.

Which of the above statements is/are correct?



  1. Only (N) and (E)

  2. Only (Q)

  3. Only (N) and (Q)

  4. Only (E) and (Q)

  5. Only (N)

Question 360–a

Determining system requirements is a step in the data modeling process



  1. True

  2. False

Question 361–a

Each statechart diagram describes one and only one



  1. message.

  2. object.

  3. use case.

  4. class.

Question 362–abcef

Five object-oriented models:



  1. The state chart diagram

  2. The use case diagram

  3. The sequence diagram

  4. Message diagram

  5. The collaboration diagram

  6. The class diagram

Question 363–d

How many objects of type C can be associated with each object of type F?





  1. no relation

  2. 9

  3. 5

  4. 1

  5. 0

Question 364–bd

How many objects of type F can be associated with each object of type C?





  1. no relation

  2. 5

  3. 9

  4. 1

  5. 0

Question 365–a

…………. is a variation of simple aggregation. It is a strong type of aggregation.



  1. Composition

  2. Association

  3. Component aggregation

  4. Inheritance

  5. Multiple inheritance

Question 366–a

If an attribute is private, which methods have access to it?



  1. Only those defined in the same class.

  2. Only instance methods in the same class.

  3. Only static methods in the same class.

  4. Only classes in the same package.

Question 367–abcd

Identify from among the following, the correct statements related to designing of the system architecture:



  1. One needs multiple models to address different concerns of a system, since no single model is sufficient to cover all aspects of software development.

  2. The modelling elements in the implementation view of architecture are Packages and Components along with their connections.

  3. Component View in Rational Rose addresses the actual software module organization within the development environment.

  4. In Process View, Component diagrams are created to view the run-time and executable components created for the system.

  5. Logical View does not include use case realizations and interaction diagrams.

Question 368–d

In object-oriented analysis a class is:



  1. A set of objects that can be arranged in a specialisation/generalisation hierarchy.

  2. None of the other answers

  3. A group of objects that are all related through the processes they perform.

  4. A set of objects that have similar characteristics.

  5. A group of objects that are derived from the same Use Case.

Question 369–b

In the Java Collections Framework, an iterator is



  1. An object that reifies an iteration over a data collection

  2. A class that implements the Iterator interface for a data collection

  3. All of the other answers

  4. A factory method that traverses over the elements of a data collection

Question 370–a

In the Template Method pattern, the template method is implemented in terms of other operations, which may be



  1. abstract methods

  2. hook methods that may be overridden in subclasses

  3. All of the other answers

  4. none of the other answers

Question 371–e

In the UML-style entity class ORDERS shown above, "GetOrderNo( )" is a(n) ______.





  1. protected constraint

  2. public constraint

  3. protected method

  4. private method

  5. public method

Question 372–d

In the UML-style entity class ORDERS, "SumOfOrders" is _______________.





  1. an entity attribute

  2. a constraint

  3. a method

  4. a class attribute

  5. None of the other answers

Question 373–a

In UML, an attribute that is accessible only by methods of its entity class or of its subclasses is said to be ____________.



  1. protected

  2. private

  3. exclusive

  4. persistent

  5. public

Question 374–c

In UML-style E-R diagrams, the second segment of an entity class contains ________.



  1. relationships

  2. constraints and methods

  3. entity attributes

  4. the name of the entity

  5. the cardinalities of the entity

Question 375–c

In UML, the dynamic model is captured in which diagrams?

(Choose only ONE option.)


  1. Use-Case diagrams and class diagrams

  2. Class diagrams and collaboration diagrams

  3. Interaction diagrams and state diagrams

  4. Use-Case diagrams and deployment diagrams

Question 376–a

Knowing UML means one can handle object-oriented analysis and design.



  1. False

  2. True

Question 377–a

Message event



  1. The trigger for a transition consisting of a message that has the properties of an event

  2. A transition within a state that does not remove the object from the state

  3. The destination of a transition connected to the arrowhead of the transition symbol a portion of a path in a statechart

  4. A component of a statechart that signifies the movement from one state to the next a valid sequence of transitions and states through a statechart

Question 378–bde

Package diagrams are designed for:



  1. reducing dependency

  2. depicting the overall structure of a system

  3. assisting deployment

  4. assisting testing

  5. organizing a large project into components

Question 379–d

Refer to the following UML class diagram.

Suppose the Student/Subject enrolment association is reified.

What are the appropriate multiplicities for m1, m2, m3 ,m4?





  1. *,1,*,1

  2. 1,*,1,*

  3. *,1,1,*

  4. 1,*,*,1

Question 380–c

Specialization :



  1. Describe the essence of an object for a purpose.

  2. Don’t forget that specialized objects inherit the common features of generic objects.

  3. Just tell me what is different about this particular object.

  4. A family of objects with similar structure and behavior

Question 381–c

Statechart Diagram:



  1. The communication between objects within a use case

  2. A diagram to show the various user roles and how those roles use the system.

  3. A diagram showing the life of an object in states and transitions.

  4. A diagram showing the objects that collaborate together to carry out a use case.

  5. A diagram showing the sequence of messages between objects during a use case.

  6. Either a collaboration diagram or a sequence diagram. Shows the interactions between objects

Question 382–d

The advantages of Object Oriented Analysis Design include:



  1. Seamless - The analysis, design and code models use the same concepts.

  2. Reuse - Objects (or their class) often are used in other problem domains.

  3. Matches Real World - Models are made which correspond to real things in the real world.

  4. All of the other answers

Question 383–a

The data entities from the entity-relationship diagram correspond to



  1. relationships in the class diagram.

  2. elements of the CASE tool.

  3. modules of top-down programming.

  4. data stores on the DFDs.

Question 384–d

The difference between actors and objects with the same name is that



  1. objects have behavior and actors do not.

  2. objects are external and actors are internal to the system.

  3. actors have behavior and objects do not.

  4. actors are external and objects are internal to the system.

Question 385–c

The following diagram shows the states of a student's registration on an HND.

Which of the following statements is NOT shown by the state diagram above?



  1. When a student in a dormant registration state resumes their studies, their registration become active again

  2. Only students in the active registration state can finish the course and become a HND graduate

  3. A student is allowed to intermit only once on their HND course

  4. A student with active registration state can change their state by either intermitting, withdrawing or finishing the course

Question 386–a

The following is a Class Circle drawn using UML notations isVisible(service) is





  1. public

  2. private

  3. protected

Question 387–b

The Following shows use cases for placing an order.

When placing an Order, it is necessary to supply, customer information, information about the ordered products and arrangements for mode of payment (can be credit or cash). Most of the time, the customers are sure about the products to be ordered, but, sometimes, they request for a product catalogue. The use cases participate in relationships between themselves (A to F).

These relationships can be any one of the following in picture from (i) to (iv).

Select the relationships of A



  1. ii

  2. iv

  3. iii

  4. i

Question 388–d

The information gathering technique that enables the analyst to collect facts and opinions from a wide range of geographically dispersed people quickly and with the least expense is the _____.



  1. observation

  2. questionnaire

  3. Joint Application Design (JAD) session

  4. document analysis

  5. interview

Question 389–b

The number of associations that occur between specific things is called a(n)



  1. cardinality.

  2. relationship.

  3. attribution.

  4. binary relationship.

Question 390–d

The object-oriented development life cycle consists of:



  1. identification, planning, design, and implementation phases

  2. selection, analysis, design, and implementation phases

  3. identification, design, and implementation phases

  4. analysis, design, and implementation phases

Question 391–d

The phrase "is a" refers to the object-oriented concept of ____________, and the phrase "has a" refers to the object-oriented concept of ____________.



  1. Polymorphism : Inheritance

  2. Composition : Inheritance

  3. Composition : Polymorphism

  4. Inheritance : Composition

Question 392–b

The triangle in picture indicates a ________________relationship





  1. Inherit

  2. generalisation

  3. Aggregation

  4. specialisation

  5. Association

Question 393–a

This ralationship in picture type ________________





  1. Zero or more

  2. Zero or one

  3. Exactly one

  4. Specified

  5. One or more

: 2011
2011 -> HƯỚng dẫn viết tiểu luậN, kiểm tra tính đIỂm quá trình môn luật môi trưỜNG
2011 -> Dat viet recovery cứu dữ liệu-hdd services-laptop Nơi duy nhất cứu dữ liệu trên các ổ cứng Server tại Việt Nam ĐC: 1a nguyễn Lâm F3, Q. Bình Thạnh, Tphcm
2011 -> Ubnd tỉnh thừa thiên huế SỞ giáo dục và ĐÀo tạO
2011 -> SỞ TƯ pháp số: 2692 /stp-bttp v/v một số nội dung liên quan đến việc chuyển giao CỘng hòa xã HỘi chủ nghĩa việt nam
2011 -> QUỐc hội nghị quyết số: 24/2008/QH12 CỘng hoà XÃ HỘi chủ nghĩa việt nam
2011 -> NĐ-cp cộng hòa xã HỘi chủ nghĩa việt nam độc lập – Tự do – Hạnh phúc
2011 -> BỘ NỘi vụ CỘng hoà XÃ HỘi chủ nghĩa việt nam
2011 -> Nghị quyết số 49-nq/tw ngàY 02 tháng 6 NĂM 2005 CỦa bộ chính trị VỀ chiến lưỢc cải cách tư pháP ĐẾn năM 2020
2011 -> Ủy ban nhân dân tỉnh bà RỊa vũng tàU
2011 -> Ủy ban nhân dân cộng hòa xã HỘi chủ nghĩa việt nam thành phố HỒ chí minh độc lập Tự do Hạnh phúc


1   2   3   4   5   6   7   8


Cơ sở dữ liệu được bảo vệ bởi bản quyền ©hocday.com 2019
được sử dụng cho việc quản lý

    Quê hương