You are on page 1of 7

Name : , ' .. " ' '.'.'" ", , ,.1.

RoLl No. : '." .. ' ' "."."'.""""



Invtgilator's Signature: ' ' .. "" . , , , . ' .

CS/B. Tech(IT)/SEM-51IT-50 1/2009-10 .2009

OBJECT TECHNOLOGY it UML

Time Allotted : 3 Hours

Full Marks: 70

The figures in the margin indtcate full marks.

Candidates are required to give their answers in their own words as Juras practicable.

GROUP -.A

( Multiple Choice Type QuestloDs )

1 . Choose the correct alternatives of the followtng: lOx 1 = 10

f

1)

How can you ensure that the memory allocated by an object is freed ?

al By invoking the free method on the object

b) By calling System.gel) method

cl By setting all references to the object to new values I say null )

dl Garbage collection cannot be forced. The programmer cannot force the JVM top free the memory used by an object.

55202

[Tum over

CS/B.Tech(m/SEM-5/IT-501/2009-10

jj) If a base class has a method defined as abstract void method();

Which of the following lines is mandatory in the derived class?

a) void method() { }

b) tnt method() {return O;}

c) void method( tnt i ) { }

d) private void method() { }

W) Which of the following statements is true ?

a) The wait method defined in the thread class can be used to convert a thread from running state tc waiting state

b) The wait(), notify() and notify all() methods must be executed in synchronized code

c) the thread class Is an abstract class

d) none of these.

ivl Exception is defined in package.

a) java. util b) Java.lang

c) java.awt d) java.to

v) What is the error in the following code? . class Test {

abstract void display ( ) ;

}

a) No error

b) Method display() should be declared as static

c) Test class should be declared as abstract

d) Test class should be declared as public.

55202 2

CS/B.Tech(rn/SEM-5/IT-501/2009-10 Vi) Which one of the following statements is false?

. a) Java supports multi-threaded programming

b) Threads in a single program can have different properties

c) Multiple threads can manipulate files and get user input at the same time

d) Two threads can never act on the same object at the same time

e) Threads are created and started with different methods.

v11) Relation name aggregation means

a) assoctation between two logically unrelated classes

b) inheritance

c) Part - of

d) none of these.

vU1) Swim Lane is defined in

a) state chart diagram b) use case diagram

c) act1v1ty diagram d) sequeq.ce diagram.

55202

3

[Turn over

CS/B.Tech{lT)/SEM-5/IT~501/2009-10

ix) Consider the following class definitions :

Class studentextends string . {

}

What happens when we try to compile this class?

a) will not compile because class body Is not defined

b) will not compile because the class Is not declare

"public" .

c) will not compile because string 1s "abstract"

d) Will not compile because string is "final"

e) will compile successfully .

.

x) Which exception is thrown by the read() method f

inputStream class?

a) Exception
b) FUeNotFoundExceptlon
c) Readlsxception
d) IOException
e) None of these. GROUP -B

( Short Answer Type Questions) Answer any three of the following.

3x5=

2. Draw the state transition diagram of Java Thread.

3. Differentiate between the following :

a) Abstract class and interface

b) Object and object reference

c) Static and final keyword

d) Method overloading and method overriding.

55202 4

CS/B.Tech(m/SEM-5/IT -501/2009-10

4. Class A {

private int Xi static int Yi

int display (int a, int b)

(

System.out.println(nx=" + X + ny=n +y) i

d

}

What will be the memory allocation for attributes and method in objects a l , a2 of type A? Only picture of aI· and a 2 along With their member and their memory size required.

5.

Why is U.ML called unified? Why is it .called a language when UML is a bunch of diagrams? What are the different

phases of Rational Unified Process?

1+2+2

6. a) Explain "pubUc static void main( Stringl J argsl" in brief.

b) What is a wrapper class ?

3+2

15

GROUP- C

( Lon, Answer Type Questions)

Answer any three of the following. . 3 x 15 = 45

7. a) Explain "Use Case" diagram -. What are the essential criteria for ideal use case diagram? What are the "extends and includes" constructs in use case diagram? Draw a use case diagram Nursing Home functionality where example actors are Patient, Doctor, Reception Staff, Billing Staff and Administrator etc.

b) Explain state chart and activity diagram with example. (1+2+2+5)+5

.55202

5

[Turn over

CS/B.Tech(rI1/SEM-5/IT-501/2009-10

8. a) What is an interface? Implement interface in Java with a simple code.

b) Explain inheritance with Its types.

c} Explain all the keywords of the statement :

public static void mafn( String( ) args)

d) Why is string type array used in the parameter of main() method ?

e) GiVe a method thatdoes not declare any exception. Can we override that method in a subclass to throw an exception ? 3 + 5 + 3 + 2 + 2

9. al ~y do we model sequence diagrams?

b) What are the four types of messages used in sequence diagrams? What are the differences between synchronous and asynchronous messages ?

c) Draw a sequence diagram for the situation when a teacher views grades of a student. You must include objects. different messages, alternative workflows, branching suitably in the diagram. 2 + 4 + 9

10. al Write down a Java code to generate a linear singly linked list having at least 4 nodes.

b) Discuss Applet life-cycle indicating the functlons, which are used.

c) What do you mean by 'Java is a platform dependent

~age'? 5 + 7 + 3

55202 6

CS/B.Tech(IT)/SEM-5/IT-501/2009-10

11. a) What is class? How does it accompUsh data hiding ?

b) When do we declare a method or class as "final" ?

c) Discuss the different levels of access protection available in Java.

d) Correct the code for overloading methods?

public class Figure

{

public String draw(String s)

(

{

return "Figure Drawn"

}

public void draw(string s) {} public void draw(double f) {}

e) Describe different forms of inheritance with examples. 3+2+3+2+5

55202

7

You might also like