MIT103-B1477- MQP

download MIT103-B1477- MQP

of 21

Transcript of MIT103-B1477- MQP

  • 7/23/2019 MIT103-B1477- MQP

    1/21

    Model Question Paper

    Subject Code: MIT103 Book ID: B1477

    Subject Name: Object Oriented Programming

    Credits: 4 Marks: 140

    Section A (Compulsory)

    Descriptive Questions (10 Marks each)

    Answer any four Questions 4 x 10 = 40 Marks

    1. A) Explain the role of digital signature in Java Security Issues [4 marks]

    (Refer section 1.5 for details)

    B) Explain features of Java. [6 marks]

    (Refer section 1.3 for details)

    2. A) What are the different types of control statements? [4marks]

    (Refer section 3.3 for details)

    B) How do you compile and execute a Java program? [6 marks]

    (Refer figure 3.2 for details)

    3. A) What is an exception? [5 marks]

    (Refer section 6.2 for details)

    B) What are the different methods under DataInputStream and DataOutputStream? [5marks]

    (Refer section 7.3 for details)

    4. A) Explain lifecycle of an Applet. [5 marks]

    (Refer section 8.5 for details)

    B) Explain lifecycle of a servlet. [5marks]

    (Refer section 14.3.3 for details)

    5. A) Explain the various URL objects. [5 marks]

    (Refer section 13.3 for details)B) Explain the working of Bean Box? [5 marks]

    (Refer section 12.4 for details)

    6. Draw and explain the JDBC Application Architecture? [10 marks]

    (Refer section 11.4 for details)

  • 7/23/2019 MIT103-B1477- MQP

    2/21

    Section B

    Multiple Choice Questions

    Part A (One Mark Questions) 50 x 1 = 50 Marks

    1. Which of the following is an object encapsulated inside the System class?

    A) out

    B) println

    C) Both A and B

    D) None of the above

    2. Employee emp = ______________ Employee ();Pick a suitable word from the list so

    that an object of the class Employee is created.

    A) object

    B) class

    C) run

    D) new

    3. What is the output for the following code: System.out.println (Hello World);

    A) Shows error

    B) Hello World

    C) Hello World

    D) None of the above

    4. _____________ provides a standard interface to common system resources.

    A) new

    B) API

    C) SystemD) None of the above

    5. Which of the following is also known as SDK:

  • 7/23/2019 MIT103-B1477- MQP

    3/21

    A) devkit

    B) JVM

    C) JDK

    D) None of the above

    6. Which feature of Java is used to dynamically link code in a safe and expedient manner:

    A) Secure

    B) Distributed

    C) Dynamic

    D) Robust

    7. Which of the following additional package is included by JDK:

    A)java.awt

    B) sun.addtools.debug

    C)java.util

    D) sun.tools.debug

    8. Which among the following is not a feature of Java:

    A) Portable

    B) StructuredC) Distributed

    D) High Performance

    9. ____________ is a Java run-time system that choose to execute the JAVA Bytecode:

    A) SDK

    B) JDK

    C) JVM

    D) None of the above

    10. Which of the following operators are used to compare two values and give the results:

    A) Increment and Decrement

    B) Logical

    C) Comparison

  • 7/23/2019 MIT103-B1477- MQP

    4/21

    D)Arithmetic

    11. What is the result of the expression: 10+5*8-15/5

    A) 3

    B) 47

    C) 7

    D) 21

    12. _________ is a common programming construct that is based upon a sequence of nested if:

    A) switch

    B) nested if

    C) if-else-if ladder

    D) None of the above

    13._________ statement is Javas multi-way branch statement.

    A) switch

    B) nested if

    C) break

    D) if-else-if ladder

    14. Which loop always executes its body at least once, even though the condition is not true:A) for

    B) do-while

    C) while

    D) continue

    15. _________ is used to exit from a loop:

    A) continue

    B) quit

    C) break

    D) None of the above

    16. Which of the following method can be used to set the size of the buffer:

  • 7/23/2019 MIT103-B1477- MQP

    5/21

    A) ensureCapacity( )

    B) length( )

    C) capacity( )

    D) setLength( )

    17. Which of the following method returns the reversed object on which it is called:

    A) insert( )

    B) replace( )

    C) delete( )

    D) reverse( )

    18. String indexes begin at:

    A) 1

    B) 3

    C) 0

    D) 2

    19. Which of the following is a special operator to allocate memory:

    A) New

    B) Old

    C) ++

    D)

    20. Both the String and StringBuffer classes are defined in ___________ package:

    A)java.awt

    B)java.io

    C)java.lang

    D)java.util

    21. Method used to extract a single character from a String:

    A) toCharArray( )

    B) getChars( )

    C) getBytes( )

  • 7/23/2019 MIT103-B1477- MQP

    6/21

    D) charAt( )

    22. Human Being and Elephant fall under which of the following relationship:

    A) Kind-Of

    B) Is-A

    C) Part-Of

    D) Has-A

    23. Which of the following allows the creation of hierarchical classifications:

    A) Interface

    B) Inheritance

    C) Package

    D) Polymorphism

    24. A class member that has been declared as private will be ____________ to its class.

    A) Friendly

    B) Public

    C) Protected

    D) Private

    25. Which of the following keywords is used to prevent inheritance:

    A) final

    B) catch

    C) extends

    D) super

    26. Java supports ________ access specifiers.

    A) 1B) 2

    C) 3

    D) 4

  • 7/23/2019 MIT103-B1477- MQP

    7/21

    27. __________ is used as a base class to derive specific classes of the same kind.

    A) private

    B) friend class

    C) abstract class

    D) super class

    28. Writing the same code in different places, leading to unnecessary replication of code:

    A) Code extensibility

    B) Code redundancy

    C) Code reusability

    D) None of the above

    29. Which of the following blocks can be nested:

    A) catch

    B) finally

    C) try

    D) None of the above

    30. Number of finally blocks that are there for an exception-handler.

    A) 1B) 2

    C) 3

    D) 4

    31. The _________ statement takes an object of an exception class as a parameter.

    A) try

    B) if

    C) catchD) finally

    32. DataInputStream and DataOutputStream classes are:

    A)Abstract streams

    B) Mode streams

  • 7/23/2019 MIT103-B1477- MQP

    8/21

    C) Markable streams

    D) Filter streams

    33. Unicode is used to represent data such that each character is represented by:

    A) 8 bits

    B) 16 bits

    C) 64 bits

    D) 32 bits

    34. Java provides ____________ to perform I/O operations at specified locations within a file:

    A) InputStreamReader

    B) RandomAccessFile

    C) DataInputStream

    D) DataOutputStream

    35. Which of the following is not a method of DataInputStream class:

    A) void writeInt (int v )

    B) int readInt ()

    C) byte readByte ()

    D) char readChar ()

    36. Which of the following class lays the foundation for the output class hierarchy:

    A) Reader

    B) InputStream

    C) OutputStream

    D) None of the above

    37. InputStream class method is:A) open( )

    B) skip( )

    C) flush( )

  • 7/23/2019 MIT103-B1477- MQP

    9/21

    D) write( )

    38. The streams that are read from or written to a specific place like a disk file or memory:

    A) Markable streams

    B) ByteArray streams

    C) Mode streams

    D) Filter streams

    39. Graphics class is a part of :

    A)java.applet package

    B)java.util package

    C)java.io package

    D)java.awt package

    40. Which of the methods is called immediately after the init() is called:

    A) destroy( )

    B) start( )

    C) paint( )

    D) stop( )

    41. Context can be retrieved using which of the following method:

    A) getNum( )

    B) getGraphics( )

    C) getAppletContext( )

    D) getText( )

    42. Which of the following methods is defined by AWT Component class:

    A) paint( )B) init( )

    C) stop( )

    D) start( )

  • 7/23/2019 MIT103-B1477- MQP

    10/21

    43. The argument temporaryFlag is set to true if the focus event is:

    A) temporary

    B) gained

    C) lost

    D) retrieved

    44. _______ object is generated when the mouse is used.

    A)AdjustmentEvent

    B) MouseEvent

    C) PaintEvent

    D) TextEvent

    45. Which of the following is at the top of the event class hierarchy:

    A)java.awt.AWTEvent

    B)java.awt.EventObject

    C)java.util.EventObject

    D) None of the above

    46. In Java, events are represented by:

    A) ObjectsB)Anonymous classes

    C) Inner classes

    D) Classes

    47. Which of the following class has empty methods:

    A)Anonymous class

    B)Adapter class

    C) Nested classD) None of the above

    48. The method that returns the event ID that represents the nature of the event:

    A) getId( )

  • 7/23/2019 MIT103-B1477- MQP

    11/21

    B) getNature( )

    C) getName( )

    D) getValue( )

    49. Which of the following Swing Components hierarchically extends AWT applet:

    A) JTree

    B) JToolTip

    C) JApplet

    D) JPanel

    50. ____________ components allow the editing of multiline plain text.

    A) Tree

    B) Text area

    C) Text field

    D) Toggle

    Part B (Two marks questions) (25*2 = 50 marks)

    51. _______and _____ are advanced commands for debugging the programs available in JDK

    I. upII. classes

    III. methods

    IV. down

    A) I and II

    B) I and IV

    C) II and III

    D) III and IV

    52. _______ is a JDK command used to break for the specified exception and _________

    command used to ignore when the specified exception:

    I. break

    II. catch

    III. ignore

  • 7/23/2019 MIT103-B1477- MQP

    12/21

    IV. ign

    A) I and III

    B) II and III

    C) II and IV

    D) None of the above

    53. ______ is used to compile Java Programs into Bytecode and __________ runs the Java

    Bytecode.

    A)java, javac

    B)javac, javah

    C)javac, java

    D) None of the above

    54. Choose the wrong statement regarding Keytool:

    I. Manages the own public key pairs

    II. Doesnot manage the private key pairs

    III. Manage Security Certificates

    IV. It is one of the command in JDK

    A) I and IV

    B)II and III

    C) II and IV

    D) I and III

    55. The keywords __________ and __________ are reserved but not used.

    I. const

    II. try

    III. goto

    IV. volatile

    A) I and IV

    B) II and III

    C) II and IV

  • 7/23/2019 MIT103-B1477- MQP

    13/21

    D) I and III

    56. __________ provides a standard interface to common

    system resources and encapsulates__________ which represents standard output

    device.

    I. System

    II. println

    III. out

    IV. object

    A) I and IV

    B) II and III

    C) II and IV

    D) I and III

    57. Methods that are specialized forms of regionMatches( ):

    I. compareTo( )

    II. startsWith( )

    III. endsWith( )

    IV. compareToIgnoreCase( )

    A) I and IV

    B) I and III

    C) II and III

    D) I, II and III

    58. Which of the following statements is true:

    I. "Foobar".endsWith("bar");

    II. "Foobar".startsWith("Foo");

    A) I

    B) II

    C) Both I and II

    D) None of the above

    59. A string is ______ another string if it comes ______ the other in dictionary order.

  • 7/23/2019 MIT103-B1477- MQP

    14/21

    A) greater than, after

    B) less than, before

    C) equal to, after

    D) equal to, before

    60. Pick String Modification Methods:

    I. toUpperCase( )

    II. length( )

    III. trim( )

    IV. capacity( )

    A) I and IV

    B) I and III

    C) II and III

    D) I, II and III

    61. Package is both a ______ and ______control mechanism.

    I. Naming

    II. Visibility

    III. Scope

    IV.AccessA) I and IV

    B) I and III

    C) II and III

    D) I and II

    62. Variables declared inside the interface declarations are implicitly __________ and

    __________.

    I. final

    II. public

    III. dynamic

    IV. static

  • 7/23/2019 MIT103-B1477- MQP

    15/21

    A) I and IV

    B) I and III

    C) II and III

    D) I and II

    63. Which of the following methods are used to access data?

    I. getResultOne()

    II. getInt()

    III. getFloat()

    IV. getOne()

    A) I and IV

    B) I and III

    C) II and IV

    D) II and III

    64. Exception Handling helps programmers develop _______ and _______ programs.

    I. secure

    II. robust

    III. error free

    IV. smallA) II and IV

    B) I and II

    C) II and III

    D) I and IV

    65. The exception object contains information about the ________ and __________ when the

    exception occurred.

    I. State of the programII. Variable data

    III. Type of error

    IV. Debugging information

    A) II and IV

  • 7/23/2019 MIT103-B1477- MQP

    16/21

    B) I and II

    C) I and III

    D) II and III

    66. close( ) method falls under which of the following class:

    I. InputStream

    II. OutputStream

    III. Writer

    IV. FileStream

    A) II and IV

    B) I and II

    C) I and III

    D) II and III

    67. Which of the following are the mode streams:

    I. FileInputStream

    II. DataOutputStream

    III. DataInputStream

    IV. FileOutputStream

    A) I and IV

    B) II and III

    C) I and II

    D) I and III

    68. Which of the following are the Stream classes:

    I. Reader

    II. DataOutputStream

    III. WriterIV. FileOutputStream

    A) II and IV

    B) I and III

  • 7/23/2019 MIT103-B1477- MQP

    17/21

    C) I and IV

    D) II and III

    69. Which of the following classes convert data between the byte and Unicode character

    streams:

    I. InputStreamReader

    II. InputStreamWriter

    III. OutputStreamWriter

    IV. OutputStreamReader

    A) II and IV

    B) I and III

    C) I and IVD) II and III

    70. Statements that are used to import the Containers:

    I. java.awt.Window

    II. java.awt.Canvas

    III.java.awt.Choice

    IV.java.awt.Panel

    A) II and IVB) I and III

    C) I and IV

    D) II and III

    71. DebuggerCallback interface is a template for implementing communications between:

    I. Client

    II. Application

    III. Server

    IV. Debugger

    A) II and IV

    B) I and III

    C) I and IV

    D) II and III

  • 7/23/2019 MIT103-B1477- MQP

    18/21

    72. Which of the following enables to open standard socket connections to hosts and read to

    and write from those connections:

    I. Socket

    II. InetAddress

    III. ServerSocket

    IV. ClientSocket

    A) II and IV

    B) I and III

    C) I and IV

    D) II and III

    73. RemoteStackVariable class has which of the following methods:

    I. getValue( )

    II. inScope( )

    III. setValue( )

    IV. getLine( )

    A) II and IV

    B) I and III

    C) I and IID) I and IV

    74. Methods used to set the values of INPUT parameters:

    I. setInt( )

    II. setString( )

    III. setOne( )

    IV. setTwo( )

    A) I and IV

    B) I and II

    C) I and III

    D) II and III

  • 7/23/2019 MIT103-B1477- MQP

    19/21

    75. Which of the following are located inside javax.swing package:

    I. Utility classes

    II. Data base components

    III.AWT components

    IV. Swing components

    A) II and IV

    B) I and II

    C) I and IV

    D) II and III

  • 7/23/2019 MIT103-B1477- MQP

    20/21

    Answer Keys (Part A & Part B)

    Subject Code: MIT103 Book ID: B1477

    Part - A Part - B

    Q.

    No.Ans. Key

    Unit no. /

    Page no.

    Q.

    No.Ans. Key

    Unit no. /

    Page no.

    Q.

    No.Ans. key

    Unit no. /

    Page no.

    1 A 2/23 26 C 5/84 51 B 1/10

    2 D 2/24 27 C 5/95 52 B 1/11

    3 B 2/24 28 B 5/81 53 C 1/10

    4 C 2/23 29 C 6/108 54 C 1/11

    5 A 1/9 30 A 6/112 55 D 2/17

    6 C 1/8 31 C 6/112 56 D 2/23

    7 D 1/8 32 D 7/120 57 C 4/64

    8 B 1/5 33 B 7/121 58 C 4/64

    9 C 34 B 7/123 59 B 4/65

    10 C 3/32 35 A 7/120 60 B 4/70

    11 B 3/33 36 C 7/116 61 D 5/97

    12 C 3/37 37 B 7/121 62 A 5/101

    13 A 3/38 38 C 7/116 63 D 11/180

    14 B 3/45 39 D 8/132 64 B 6/105

    15 C 3/48 40 B 8/130 65 C 6/108

    16 A 4/72 41 C 8/128 66 B 7/121

    17 D 4/74 42 A 8/131 67 A 7/120

    18 C 4/60 43 A 9/151 68 A 7/119

    19 A 4/53 44 B 9/145 69 C 7/122

    20 C 4/55 45 C 9/144 70 C 8/138

    21 D 4/60 46 A 9/144 71 A 13/203

    22 A 5/80 47 B 9/158 72 B 13/201

    23 B 5/79 48 A 9/145 73 C 13/206

    24 D 5/87 49 C 10/171 74 B 11/182

    25 A 5/96 50 B 10/173 75 C 10/167

  • 7/23/2019 MIT103-B1477- MQP

    21/21