WBUT Question Papers EE Object Technology And Uml B Tech 6th Sem June- 2009

WBUT Question Papers EE

Object Technology And Uml  B Tech 6th Sem June- 2009

                           

 

Time : 3 Hours J                                     [ Full Marks : 70

GROUP – A ( Multiple Choice Type Questions)

  1. Choose the correct alternatives for any ten of the following :              10×1 = 10

i)                The method int func(int i, int J) {} can be overloaded using

A)               int func (int i, int J, int k ) {}

B)              int func ( float i, int j ) {}

C)              float func (int i, int j ) {}

D)             int func (int a, int b ) {}

E)              float func (int I, int j, float k ) {}

a)         (B) & (C) b) (C) & (D)

c)          (A), (B), (C) & (E)      d) (A), (B) & (E).                      | ^

ii)              int j;

for (int i = 0; i < 14; i ++ ) { if (i < 10 ) { j = 2 + i; •

}        —V.;

System.out.println (“j:” + j+” i:” + i);

What is WRONG with the above code ?

a)              Integer “j” is not initialized

b)              Nothing

c)              You cannot declare integer I inside th for-loop declaration

d)             The syntax of the “if ’ statement incorrect

e)     You can not print integer values without converting them to strings.

ill) What will happen If you compile / run this code ? public class Q1 extends Thread {

public void run (

System.out.println (“Before start method”); this.stop (); .

System.out.println (“After stop method”);

public static void main (String [ ] args)

Q1 a = newQl ();

  1. start ();

a)              Compilation error at line 7

b)              Runtime exception at line 7

c) Prints “Before start method” and “After stop method”.

d)             Prints “Before start method” only.

lv) Which one of the following is a valid declaration of an Applet ?

a)  Public class MyApplet extends java.applet.Applet {

b)              Public Applet MyApplet {

c)  Public class MyApplet extends applet Implements Runnable {

d) Abstract class MyApplet extends Java, applet .Applet {

e)              – Class MyApplet implements Applet {  Si®?!

v)              What is the range of the char type ?

a)              0 to 216               b) 0 to 215

c)              0 to 216 – 1           d) 0 to 215 _ i

vi)            Aggregation ( encapsulation ) relationships are represented in the UML notation by                       –

sQ nesting of classes

b)              lines with a solid diamond at one end

c)              lines with a hollow diamond at one end

d)              lines with an arrow at one end

e)              lines without an arrow at either end.

vii)          A sequence diagram is

a)              a time-line illustrating a typical sequence of calls between object function members

b)              a call tree illustrating all possible sequences of calls between class function members

c)              a time-line illustrating the changes in inheritance and instantaneous relationships between classes and objects over time

d)    a tree illustrating Inheritance and relationships between classes

e)  a directed cyclic graph illustrating inheritance and instantaneous

relationships between classes and objects,

viii)         Which of the following are true ?

a)              The InputStream and OutputStream classes are Byte-oriented.

b)              The ObjectlnputStream and ObjectOutputStream do not support serialized object input and output.

c)              The Reader and Writer classes are Character-oriented.

d)    The Reader and Writer classes are the preferred solution to serialized

object output.

Ix) What is an example of polymorphism ?>

a]   Inner class  b) Anonymous classes

c)  Method overloading     d) Method overriding.

x) Exception is defined in which package ?

a)    java.util  b) java.lang

c)   Java.awt   d) Java.io.

jd) The relation between classes can be represented by

a) polymorphism    b) method

c) message d) inheritance.

xii)           switch (i) {

default:        .

System, out.prlntln (“Hello”);

What is the acceptable type (s) for the variable i ?

a)         int          b) double

c)       object   d) byte.

xiii)        The import statement is always

a)              the first non-comment statement in a Java program file

b)              the default non-comment statement in Java program file

c)    a non-comment statement and can be defined anywhere in the program

d)              none of these.

xiv)         Method overloading occurs only when

a)    the names and the type signature of two methods are not identical

b ) the names and the type signature of two methods are identical

c)               the names and the return types of two methods are identical

d)              only the names are identical.

xv)           An Actor is someone or something

a)              that must interact with the syjstem

b)              that always external to the system

c)              that Eire not part of the system

d)              all of these.

GROUP – B ( Short Answer Type Questions)

Answer any three of the following.    3×5=15

  1. What is byte code ? What does the JVM do ? Why is Java called compiler-interpret language ?
  2. Discuss Applet life-cycle indicating the functions.
  3. a) What is an Actor ?
  4. Describe the Metaclass. Is it different from Metadata 7                                                                                                 
  1. What is the base class of Error and Exception ? Differentiate between throw and throws.
  2. a) What is Late binding ?
  3. Describe major and minor elements of Object Oriented Analysis.                                                                                
  1. a) Write down the similarities and differences between interfaces and classes.

b)              Discuss the various levels of access protection available for package and their implementation.

GROUP -C (Long Answer Type Questions )

Answer any three questions.         3 x 15 = 45

  1. What are the primary goals of UML ? What is the difference between state chart diagram and activity diagram ? Model an activity diagram for the usecase of a driver

starting a car. Explain the sequence diagram and collaboration diagram with an

.example used in UML.

  1. a) What are Java “thread” and “monitor” ?

b)               Distinguish between “dynamic binding” and “Message passing”

c)               What is ‘Template” and “Package” with example.    5 + 5 + 5

  1. a) What is meant by aggregation ? And explain the different types of aggregation.

b)              What are the differences between a sequence diagram and a collaboration diagram?

c)               Draw a sequence diagram for the cellular phone connection.

d)               Draw object diagram for the following object classes, with association names attributes and additional object classes if required.

Object classes : college, playground, principal, classroom, board, book, student, faculty, cafeteria, ruler, door, swing.  4 + 3 +

  1. What is multi-threading ? Write a program which can run a main thread and child thread simultaneously. What synchronized keyword does ? Briefly describe with example.         ‘
  2. a) How inheritance is incorporated in Java ? Is it possible in Java to implement

multiple inheritance ? If not then how is it possible explain ?                                                       7

b)               What is an interface ? What are the differences between interface and abstract class ? Give one example in Java to implement one interface.                                             8

Leave a Comment