You are on page 1of 25

QUESTION BANK

III - CSE

Dr. NAVALAR NEDUNCHEZHIYAN COLLEGE OF ENGINEERING


THOLUDUR 606 303, CUDDALORE DIST
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
ANNA UNIVERSITY CHENNAI
YEAR: III / SEM VI
CS2023 ADVANCED JAVA PROGRAMMING
UNIT I JAVA FUNDAMENTALS

Java I/O streaming filter and pipe streams Byte Code interpretation - Threading
Swing.
UNIT II NETWORK PROGRAMMING IN JAVA

Sockets secure sockets custom sockets UDP datagrams multicast sockets


URL classes Reading Data from the server writing data configuring the connection
Reading the header telnet application Java Messaging services
UNIT III APPLICATIONS IN DISTRIBUTED ENVIRONMENT

Remote method Invocation activation models RMI custom sockets Object


Serialization RMI IIOP implementation CORBA IDL technology Naming
Services CORBA programming Models - JAR file creation
UNIT IV MULTI-TIER APPLICATION DEVELOPMENT

Server side programming servlets Java Server Pages - Applet to Applet


communication applet to Servlet communication - JDBC Applications on databases
Multimedia streaming applications Java Media Framework.
UNIT V ENTERPRISE APPLICATIONS

Server Side Component Architecture Introduction to J2EE Session Beans Entity


Beans Persistent Entity Beans .
TOTAL: 45 PERIODS
TEXT BOOKS:
1. Elliotte Rusty Harold, Java Network Programming, OReilly publishers, 2000 (UNITII)
2. Ed Roman, Mastering Enterprise Java Beans, John Wiley & Sons Inc., 1999.(UNIT III and UNIT V)
3. Hortsmann & Cornell, CORE JAVA 2 ADVANCED FEATURES, VOL II, PearsonEducation, 2002.
(UNIT I and UNIT IV)
REFERENCES:
1. Web reference: http://java.sun.com.
2. Patrick Naughton, COMPLETE REFERENCE: JAVA2, Tata McGraw-Hill, 2003.

Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

SUBJECT NAME: ADVANCED JAVA PROGRAMMING


SUBJECT CODE: CS2023
UNIT I

JAVA FUNDAMENTALS
PART A
1)The symbol ! in java means?
A)Logical NOT B)Logical OR C)Logical XOR D)AND

(1 MARK)

2) ____ the first web browser developed in Java?


A)Internet Explorer B)Netscape Navigator C) Opera D) HotJava
3) _______ consist a data and methods?
A)Variable B) Class C) Vectors D)None of these
4) Error and Exception classes are derived from Throwable class?
A)True B)False
5) Inheritance is one of the features of object oriented programming that allows the creation of
hierarchical classifications?
A)True B)False
6) ________ symbol denotes the current working directory?
A). (dot) B),(comma)C);(semicolon)D);(colon)
7) _____ is the ability of an Java application to perform multiple tasks at the same time?
A)Multiprogramming B)Multithreading C)Multiprocessing D)Multitasking
8) What are the types of access specifiers in Java?
A)public B) private, protected C)Both A & B D)None of the above
9) Mosaic is the first graphical browser?
A)True B)False
10)Consider the following program:
import myLibrary.*;
public class ShowSomeClass
{
// code for the class...
}
What is the name of the java file containing this program?
A. myLibrary.java
B. ShowSomeClass.java
C. ShowSomeClass
D. ShowSomeClass.class
11)Which of the following is TRUE?
A. In java, an instance field declared public generates a compilation error.
B. int is the name of a class available in the package java.lang
C. Instance variable names may only contain letters and digits.
D. A class has always a constructor (possibly automatically supplied by the java

Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

compiler).
E. The more comments in a program, the faster the program runs.
12)Consider the following code snippet
String river = new String(Columbia);
System.out.println(river.length());
What is printed?
A. 6
B. 7
C. 8
D. Columbia
13)A constructor
A. must have the same name as the class it is declared within.
B. is used to create objects.
C. may be declared private
D. A and B
E. A, B and C
14)Which of the following may be part of a class definition?
A. instance variables
B. instance methods
C. constructors
D. all of the above
E. none of the above
15)What is different between a Java applet and a Java application?
A. An application can in general be trusted whereas an applet can't.
B. An applet must be executed in a browser environment.
C. An applet is not able to access the files of the computer it runs on
D. (A), (B) and (C).
E. None of the above
16)Consider
public class MyClass{
public MyClass(){/*code*/}
// more code...
}
To instantiate MyClass, you would write?
A. MyClass mc = new MyClass();
B. MyClass mc = MyClass();
C. MyClass mc = MyClass;
D. MyClass mc = new MyClass;
E. It can't be done. The constructor of MyClass should be defined as
public void MyClass(){/*code*/}
17)What is byte code in the context of Java?
A. The type of code generated by a Java compiler
B. The type of code generated by a Java Virtual Machine
C. It is another name for a Java source file
D. It is the code written within the instance methods of a class.
18)What is garbage collection in the context of Java?
A. The operating system periodically deletes all of the java files available on the
system.
B. Any package imported in a program and not used is automatically deleted.

Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

C. When all references to an object are gone, the memory used by the object is
automatically reclaimed.
D. The JVM checks the output of any Java program and deletes anything that
doesn't make sense.
E. Janitors working for Sun MicroSystems are required to throw away any
Microsoft documentation found in the employees' offices.
19)You read the following statement in a Java program that compiles and
executes.
submarine.dive(depth);
What can you say for sure?
A. depth must be an int
B. dive must be a method.
C. dive must be the name of an instance field.
D. submarine must be the name of a class
E. submarine must be a method.
20)What is an infinite loop?
A)A loop that functions infinitely well
B)A loop that runs forever
C)A loop that never starts
D)A loop that will never function
1 2
3 4
5 6
7
8 9 10 11 12 13 14 15 16 17
A D B A A A B C A B D C E D D A A
PART B

18
C

19
B

20
B

(2 MARK)

21. Write a short note on oops?

Oops stands for object oriented programming structure. Object oriented programming develops a
program around its data and sets well defined interfaces to that data.
22.

23.

List the features of Java.

a. Simple and powerful


b. Portable
c. Robust
d. Architecture neutral
e. Distributed
What is mean by encapsulation?

Secure
Object oriented
Multithreaded
Interpreted and high performance
Dynamic

Encapsulation is the mechanism that binds together code and the data it manipulates,
and keeps both safe from outside interference and misuse.
24. What is mean by inheritance?
Inheritance is the process by which one object acquires the properties of another object.
25. What is polymorphism? (AU NOV DEC 2012)
Polymorphism is a feature that allows one interface to be used for a general class of actions.
26. What are the two parts of a Java program?
The two parts of a Java program are
i. Applet program
ii. Application program

Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

27. What are the kinds of variables in Java? (AU NOV/DEC 2011)
Java has three kinds of variables namely,
a. Instance variables
b. Local variables
c. Class variables
28. What are the various kinds of literals?
There are different types of literals. They are:
a. Number literals
b. Character literals
c. Boolean literals
d. String literals
29. What are wrapper classes? (AU NOV/DEC 2011)
Wrapper classes are provided for the primitive data types in order to use these types as objects. The
wrapper classes for the primitive data types have the same name as the primitive type, but with the
first letter capitalized.
30. What is a method?
Methods are functions that operate on instances of classes in which they are defined. Objects can
communicate with each other using methods and can call methods in other classes. Just as there are
class and instance variables, there are class and instance methods. Instance methods apply and operate
on an instance of the class which class methods operate on the class.
31. Describe output streams and input streams in Java.( AU NOV DEC 2012)
I/O in Java is built on streams. Input streams read data. Output streams write data. Different
fundamental stream classes such as java.io.FileInputStream and sun.net.TelnetOutputStream read and
write particular sources of data.

PART B
(16 MARKS)
32. Explain the features of Java.
33. Briefly explain about fundamentals of Java programming.
34. Explain about the classes.
35. Discuss about the Java class library.
36. What is a vector class in Java? Explain with examples.
37. Describe the methods used to establish inter thread communication in Java.
38. Compare threads and processes.
39. Write a Java program to implement merge sort. Use java.lang comparable interface.
40. What is constructor? Explain with examples.
41. Explain the following:
i. Introduction to inheritance
ii. Advantages of inheritance
42. Briefly explain about I/O streams.
43. Define I/O stream types. (AU NOV DEC 2012)
44. What is mean by filter stream? Explain with examples.
45. Briefly explain about advantages of swing.
46. Describe the common thread methods.

Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

47. What is a dynamic reflexive class? Explain with examples.


48. Define byte code interpretation.
49. Briefly explain about reflection. (AU NOV/DEC 2011)
50. What is a thread? Explain with examples.( AU NOV/DEC 2011) (AU NOV DEC 2012)
51. Explain the differences between byte stream and character stream with necessary examples.
52. List the methods useful for effective interthread communication. (AU Nov/Dec 2010)
53. What is CORBA? (AU Nov/Dec 2010)
54. How will you solve dining philosopher problem using java multithreading? (AU Nov/Dec
2010)

UNIT II

NETWORK PROGRAMMING IN JAVA


PART A
55.Java is designed for the distributed environment of the Internet, because it
handles_________ protocols
A) UDP
B) TCP/IP
C) FTP
D) TEL
56. Java is associated with _______ programming Language
a. Oak
b. Basic
c. C
d. Perl
57. .Which of the following is Java keyword?
a. external
b. implement
c. throw
d. Integer
58. A compiler converts the Java program into an intermediate language representation called
A)bytecode
B)byte
C)byteclass
D)bytejava
59. _____________ Operator is used to create an object.
a. class
b. new
c. print
d. main
60. Which of the following method is used to initialize the instance variable of a class.
a. Class
b. Public
c. Constructor
d. Destructor _
61. Java platform consists of JVM and a package of readymade software components this
package is known as ___________.

Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

a. Java API
b. JVM API
c. JM API
d. API
62. Which of the following is not a Looping statement ____________
A)FOR
B)Switch
C)while
D)Do-While
63. _____________ is a multi way branch statement
a. Switch
b. continue
c. break
d. Label
64. Choose the proper operator precedence when evaluating an Expression?
1. Comparisons
2. Logical operations
3. Increment
4. Arithmetic operations
a. 1-2-4-3
b. 4-3-1-2
c. 2-1-4-3
d. 3-4-1-2
65. The ______ statement is used inside the switch to terminate a Statement sequence
a. break
b. Jump
c. exit
d. goto
66. A class that is inherited is called a ____________
a. superclass
b. Subclass
c. subsetclass
d. Relativeclass
67. An _________ determines which features of a class may be used by other classes
a. specifier
b. inheritance
c. implementation
d. Access specifier
68. Which property of Java allows the creation of hierarchical classifications?
a. Interface
b. Inheritance
c. Robust
d. Distributed
69. Which of the following is WRONG statement with respect to rules for overriding Methods?
A)The method name and the order of arguments should be identical to that of the superclass
method.
B) The return type of both the methods must be the different.
C) The overriding method cannot be less accessible than the method it overrides.
D) An overriding method cannot raise more exceptions than those raised by the super class.
70. The class at the top of the exception classes hierarchy is called ____________

Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

a. Common
b. Throwable.
c. NULL
d. Catch
71. Find the keyword which is not used to implement exception
a. try
b. catch
c. finally
d. access
72. Which of the following is not a Exceptions in Java.
a. Arithmetic Exception
b. Nullpointer Exception
c. ArrayoutofBounds Exception
d. Logical Exception
73. Which of the following Definitions hold good for Exception?
a. Abnormal event that occurs during program execution and disrupts the normal flow of
Instruction.
B) The unexpected situations that may occur during program execution
C) The term exception denotes an exception event.
D) All the above
74. The _________ class creates and maintains a buffer for an input stream
a. Common BufferedInputStream
b. BufferedStream
c. InputStream
d. BufferedInputStream
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
B A C A B C A B A D A A D B B B D B D D
PART B

(2MARK)

75. What is mean by datagram?


Datagram is a type of packet that represents an entire communication. Datagram packet is the class,
which acts as the data container, and datagram socket is a mechanism used to send or receive
datagram packets.
76. What is the use of DNS?
Domain naming service (DNS) is used to map one particular IP address to a string of characters.
77. What is mean by URL connection? (AU NOV/DEC 2011)
URL connection is a general purpose class, which provides methods to know more about the
remote resource.
78. Define protocol.
Communication between computers in a network or a different network requires certain set of
rules called protocol.
79. What are the types of protocol?
Java networking is done using TCP /IP protocol. Some of the different kinds of protocols available are
HTTP (Hyper Text Transfer Protocol enables interaction with the internet), FTP (File Transfer
Protocol enables transfer of files between computers), SMTP (Simple Mail Transfer Protocol

Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

provides e-mail facility) and NNTP (Network News Transfer Protocol acts as a bulletin board for
sharing news).
80. What is the method of datagram packet?
Methods:
Send (Datagram packet d) dispatches the given datagram packet object.
Receive (Datagram packet p) receives the given datagram packet object.
Close () closes the socket connection.
81. Explain runnable.
Runnable defines only one abstract method, called run(), which is the entry point to the thread.
Threads that are created by the user must implement abstract void run() method.
82. Explain the interfaces of java.lang.
The java.lang package contains three interfaces namely clone able, comparable, and runnable.
83. What is a package class?
Package class is one that encapsulates version data associated with a package. Since it is necessary for the
java program to know what version of a package is available, package version information is needed.
84. Give the three components of collection frameworks.
Collection frameworks are composed of three components. They are:
Interfaces abstract data types representing collections
Implementations these are the actual execution of the interfaces
Algorithms these are methods that perform computation on objects that implement the interfaces.
85.Define socket. (AU NOV DEC 2012)
A socket is a connection between two hosts. It can perform following basic operations:
a. Connect to a remote machine
b. Send data
c. Receive data
d. Close a connection
e. Bind to a port
f. Listen for incoming data
86. Describe secret key encryption.
In this, the same key is used both to encrypt and decrypt the data. Both the sender and receiver have to
possess the single key.
87. Describe public key encryption.
In this, different keys are used to encrypt and decrypt the data. One key, called the public key, is used to
encrypt the data. This key can be given to anyone. A different key, called the private key, is used to
decrypt the data. This must be kept secret but needs to be possessed by only one of the correspondents.
88. Write about TCP. (AU NOV DEC 2012)
TCP is designed for reliable transmission of data. If data is lost or damaged in transmission, TCP ensures
that the data is resent; if packets of data arrive out of order, TCP puts them back in the correct order; if the
data is coming too fast for the connection, TCP throttles the speed back so that packets will not be lost.
89. Write about get methods in the DatagramPacket class.
DatagramPacket has five methods that retrieve different parts of a datagram: the actual data plus several
fields from its header. These methods are mostly used for data grams we receive from the network.
public InetAddress getAddress()
public int getPort()

Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

public byte[] getData()


public int getLength()
public int getOffset()
90. Write about set methods in the DatagramPacket class.
public void setData(byte[] data)
public void setData(byte[] data, int offset, int length)
public void setAddress(InetAddress remote)
public void setPort(int port)
public void setLength(int length)
91. Describe SO_TIMEOUT socket option.
SO_TIMEOUT is the amount of time, in milliseconds, that receive () waits for an incoming datagram
before throwing an InterruptedIOException. Its value must be non-negative. If SO_TIMEOUT is 0,
receive () never times out. This value can be changed with the setSoTimeout () method and inspected
with the getSoTimeout () method.
92. Describe SO_RCVBUF socket option.
It is closely related to the SO_RCVBUF option of socket. It determines the size of the buffer used for
network I/O. Larger buffers tend to improve performance for reasonably fast connections because they
can store more incoming data grams before overflowing.
Sufficiently large receive buffers are even more important for UDP.
93. Describe unicast socket.
Unicast sockets create a connection with two well-defined endpoints. There is one sender and one
receiver and although they may switch roles, at any given time it is easy to tell which is which.
94. Define multicasting. (AU NOV/DEC 2011)
Multicasting is broader than unicast, point-to-point communication but narrower and more targeted than
broadcast communication. Multicasting sends data from one host to many different hosts, but not to
everyone; the data goes only to clients that have expressed an interest in the data by joining a particular
multicast group.
PART B
(16 MARKS)
95. What is a socket? How is it used in networking?
96. Write a server program that will receive a filename, retrieve it and send the content of the
file to the client. Write the client program also.
97. Write a Java program to illustrate communication between client and server. (AU NOV
DEC 2012)
98. What is a MULTICAST socket? Explain with examples.
99. Describe the UDP datagram.
100. Briefly explain about the multicast socket. (AU NOV DEC 2012)
101. Explain the URL classes with examples.
102. Explain all the looping constructs in Java with an example for each.
103. What is a datagram? Explain the datagram packet and datagram server and client.
104. Describe the functions and importance of web servers and web browsers.
105. Explain the method to create own exception subclass.
106. Explain the differences between packages and interfaces.

Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

107.

Write short notes on:


i. Data grams
ii. Socket
iii. Reserved ports
iv. Domain naming service (DNS) (AU NOV/DEC 2011)
108. What are the various classes of sockets that can be created in Java?
109. What is recursion? Give simple example in Java.
110. Write short notes on URL connection class.
111. Discuss the definition and types of methods in Java.
112. Write a socket program to transfer a message from one computer system to another
computer system.
113. Briefly explain about the telnet applications. (AU NOV/DEC 2011)
114. What are frames? How they are defined and used? Explain with example.
115.
What is the difference between URL instance and URL connection instance? (AU
Nov/Dec 2010)
116. Mention the significance of accept() method. (AU Nov/Dec 2010)
117. Develop a TCP/IP program to send the details of the salary from the server to the client.
Calculate Gross pay and Net pay in the client machine. (AU Nov/Dec 2010)
118. Write a UDP program to find the average marks of a student in the client machine.
Allow the server to send the student details and mark details. (AU Nov/Dec 2010) (AU NOV
DEC 2012)
UNIT III

APPLICATIONS IN DISTRIBUTED ENVIRONMENT


PART A
(1MARK)
119. A __________ is a sequence of bytes traveling from a source to a destination over a
communication path.
A) string
B)stream
B) character
C) integer
120.
Which of the following statement is the explanation of the int read () method
a. Reads a byte of data from the input stream
b. Reads bytes of data from the input stream and stores them in the array
c. Reads the number of bytes specified by the third argument from the input stream and
stores.
d. Returns the number of bytes available for reading from the input stream
121.
Which of the following assignments is illegal in Java?
a. subclass_reference = subclass_object
b. subclass_reference = superclass_object
c. superclass_reference = subclass_object
d. superclass_reference = superclass_object
122.

A ___________ is java program that can be embedded in a Web page


a. Applets
b. browser
c. package

Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

d. None of these
123. A applet tag is written in body tag of ___________
a. HTMM
b. HTTP
c. HTML
d. Applet
124.
All applets must be declared as
a. Protected
b. Public
c. Private
d. Static
125. ________ method is called the first time an applet is loaded into the memory
of a computer
a. init method()
b. start method()
c. stop method()
d. destroy method()
126.
Which of the following is a loop construct that will always be executed once?
a. switch
b. for
c. while
d. do . While
127.
_______ provides a database-programming interface for Java programs
a. ODBC
b. JDBC
c. DBMS
d. DAT
128.
Which of the following is NOT a part of JDBC URL?
a. <protocol>
b. <subprotocol>
c. <subname>
d. <name>
129.
_________package Contains classes that help in connecting to a database
a. sql.java
b. mysql.java
c. java.sql
d. java.mysql
130.
RMI stands for
a. Remote Method Invocation
b. Remote method invention
c. Remote Memory Interface
d. Reduced Method Instructions
131.
CORBA stands for
a. Common Operation Request Broker Architecture
b. Common Object Request Bean Architecture
c. Common Object Request Broker Architecture
d. Component Object Request Broker Architecture
132.
Which of the following statements holds good for JavaBeans?
a. JavaBeans allows to efficiently constructing applications by Configuring and
Connecting Components called Beans.

Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

133.

134.

135.

136.

III - CSE

b. Java beans are used to transfer data in distributed Systems.


c. Java Bean is software component architecture of Java designed to use only in one
Particular environment
d. None of the above.
Which of the following is not a wrapper class?
a. Vector
b. Character
c. Boolean
d. Integer
Servlets provide an efficient replacement for _______ scripts
a. CGI
b. GCI
c. API
d. PIC
____________ contains the class libraries that which are needed to create servlets
a. SDK
b. JSDK
c. JDK
d. JAR
Choose the CORRECT statement.
a. To write JSP code you require a browser.
b. To test the JSPs you need a server engine.
c. JSPs looks like HTML script
d. JSP combines HTML and JDK tools

137.

Choose the WRONG Statement


a. Java is inherently suited for large client/server applications.
b. A servlet is a small pluggable extension to a server that enhances the servers
functionality
c. Java does not support networking.
d. When you use servlet to create dynamic content for a web page or otherwise extend the
Functionality of a web server.
138. using super keyword we can call
a) sub class constructor
b) super class constructor
c) child class object d) none of these

119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
B
A
B
A
C
B
B
D
B
D
C
A
C
A
A
A
B
C
C
B

PART B
(2MARKS)
139. Describe the differences between RMI and RPC.
A remote procedure call (RPC) is a procedural invocation from a process on one machine to a process on
another machine. A remote method invocation in Java takes the RPC concept one step further and allows
for distributed object communications.
140. Describe marshalling and unmarshalling.

Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

These allow passing parameters, including Java primitives and Java objects, over the network.
Marshalling and Unmarshalling is the process of massaging parameters so that they are usable on the
machine being invoked on remotely. It is the packaging and unpackaging of parameters so that they are
usable in two heterogeneous environments.
141. Define interface and implementation.
The interface defines the exposed information about an object, such as the names of its methods and what
parameters those methods take. The implementation is the core programming logic that an object
provides. It has some very specific algorithms, logic and data
142. Define remote object.
Remote objects are networked object implementation that can be called by another JVM. They implement
a remote interface and thus expose methods that can be invoked by remote clients.
143. Differentiate pass-by-value and pass-by-reference.
When invoking a method using RMI-IIOP, all parameters to the remote method are passed by-value. This
means that when a client calls a server, all parameters are copied from one machine to the other.
When we call a method in Java and pass an object as a parameter, that object is passed by reference. The
reference to the object is copied, but the actual objects data is not.
144. What is object serialization? (AU Nov/Dec 2010) (AU NOV DEC 2012)
Serialization is the conversion of a Java object into a bit-blob representation of that object.
145. Mention some rules for serialization.
Java serialization has the following rules for member variables held in serialized objects:
a. Any basic primitive type (int, char, and so on) is automatically serialized with the object
and is available when deserialized.
b. Java objects can be included with the serialized bit-blob or not.
146. Describe RMI IIOP.
Java RMI IIOP (which stands for Java Remote Method Invocation over the Internet Inter ORB
Protocol) is J2EEs de facto mechanism for performing simple, powerful networking. It allows writing
distributed objects in Java, enabling objects to communicate in memory, across Java Virtual Machines,
and across physical devices.
147. What is JNDI?
The JNDI is a J2EE API that provides a standard interface for locating users, machines, networks, objects
and services.
148. Describe directory service.
A directory service is a naming service that has been extended and enhanced to provide directory object
operations for manipulating attributes. A directory is a system of directory objects that are all connected.
149. What is DNS?
Domain Name System (DNS) is used to translate a machine name to an IP address. If we look up
wiley.com on the internet, the name wiley.com is translated into the object 199.171.201.14 by the DNS.
150. List out some benefits of JNDI.
a. JNDI insulates the application from protocol and implementation details.
b. We can use the JNDI to read and write whole Java objects from directories.
c. Using JNDI to acquire a reference to the Java Transaction API (JTA) User Transaction
interface.

Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

d. Using JNDI to connect to resource factories, such as JDBC drivers or Java Message
Service (JMS) drivers.
151. Define naming system, name spaces, composite names.
A naming system is a connected set of contexts.
A namespace is all the names contained within naming system.
A composite name is a name that spans multiple naming systems.
152. What is CORBA? (AU Nov/Dec 2010) (AU NOV/DEC 2011)
The Common Object Request Broker Architecture (CORBA) is a unifying standard for writing distributed
object systems. The standard is completely neutral with respect to platform, language and vendor.
CORBA incorporates a host of technologies and is very broad in scope.
153. Why CORBA is needed?
a. We can use CORBA for legacy integration.
b. CORBA allows for advanced middleware development.
c. CORBA and EJB have hooks connecting them.
154. List out the some drawbacks of CORBA.
a. CORBA is slow moving
b. CORBA has a steep learning curve
c. Products developed under CORBA may have incompatible features
155. Mention some services provided by CORBA.
a. The CORBA Naming Service is a CORBA service that allows to look up CORBA objects
by name, a technology similar to the Java Naming and Directory Interface (JNDI).
b. The CORBA Event Service allows for asynchronous communications between CORBA
objects.
c. The CORBA Object Transaction Service (OTS) enables CORBA objects to perform
transactions.
d. The Concurrency Control Service allows for multiple clients to concurrently interact with
a resource.
e. The CORBA Security Service adds secure functionality to our CORBA system.
156. What is ORB?
Object Request Broker (ORB) facilitates network communications. ORBs enable disparate applications
to communicate without being aware of the underlying communications mechanism. They are responsible
for finding objects to service method calls, handling parameter passing and returning results.
157. Write down the steps needed for CORBA client to calling RMI object implementation.
a. Write your RMI IIOP remote interface
b. Generate the needed server side RMI IIOP skeletons
c. Generate the OMG IDL
d. Generate the needed client-side CORBA files
e. Write the client and the server
158. What is EJB JAR file? (AU NOV/DEC 2011) (AU NOV DEC 2012)
An Ejb-jar file is a compressed file that contains everything we have described, and it follows the .ZIP
compression format. Jar files are convenient, compact modules for shipping our Java software.
PART B

(16 MARKS)
Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

159. Explain any three Java utilities.


160. Write a program to find i) Area and circumference of a square ii) Factorial of a
number
iii) First ten Fibonacci numbers
161.
Explain in detail the RMI architecture with a neat diagram. (AU NOV DEC 2012)
162. Create a client / server application using RMI in Java to perform remote calculations.
163. What are the classes in Java used in object serialization? Describe how object
serialization can be used in RMI.
164. What is meant by bean customization? What are the steps followed in writing a bean
customizer? Write the code to customize a button. (AU NOV/DEC 2011)
165. Explain the CORBA architecture programming models. (AU NOV DEC 2012)
166. Briefly explain about the JAR file creation.
167. Write the applications of CORBA programming. (AU NOV/DEC 2011)
168. Write a Java program that writes a set of string to an output file and then reads the file
to verify that the output was written correctly.
169. List any two protocols used in RMI technology. (AU Nov/Dec 2010)
170. Write a note on Java IDL and CORBA. (AU Nov/Dec 2010)
171.
Write a program to implement an examination control system using RMI in which the
server has all the student information and the student objects can be accessed from any
client. (AU Nov Dec2010)

MULTI TIER APPLICATION DEVELOPMENT


PART A
(1 MARK)
172.Data can be passed to the function through
a) Call by value
b) call by reference
c) both of above
d)none of these
173.Which of the following loop will be execute at least once even if the condition is false
a) for loop
b) do-while loop c) while loop d) none of these
174.Which of the following loop will not execute at least once if the condition is false
a) for loop
b) do-while loop
c) while loop d) none of these
175. Inheritance helps in

UNIT IV

a) Reduce redundancy in code


b) speed up the program
c) Easy to read
d) none of these
176.The ++ operator postfix and prefix has the same effect
a) True
b) false
C) Sometime true & sometime false d) none of these
177. x=10,y=5 what would be value of z after executing the following statement
if(x>=9&&y<=8)z=x+y
else
z=x-y
a) 15
b) 5
c) 13
d) none of these

Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

178. Member of the structure are accessed by ----------- operator


a) address operator
b) dot operator
c) scope resolution op d) none of these
179. constructor can be overloaded
a) true
b) false
c) in special cases
d)none of these
180. which of the following is not the feature of object oriented programming
a. Data encapsulation
b. Inheritance
c. Operator overloading
d. data structure
181. I)ODBC works on the top of JDBC
II) Static variable by default initialized with junk values
A) Both I & II is true
B) Both I and II is false
C) I is true II is false
D) I is false II is true
182. I) static data member have different copy each associated with the object of
class II)
There is only single copy of member function in memory when a class is loaded
i. Both I & II is true
ii. Both I and II is false
iii. I is true II is false
iv. I is false II is true
183. i) Jdbc driver manager is the backbone of the odbc architecture
ii) Javas RMI approach makes use of stubs and skeletons.
a. i is true ii is false
b. i is false ii is true
c. Both are true
d. Both are false
184.I) A continue statement can be used with switch
II)jdbc provides a database-programming interface for java program
i. Both I & II is true
ii. Both I and II is false
iii. I is true II is false
iv. I is false II is true
185.I) private member of an class can be directly access through object of that class
II) constructor of an class is executed each time when an object of that class is created
a. I is true II is false
b. I is false II is true
c. Both are true
d. Both are false
186. i)an applet can be executed using the appletviwer or a java enabled browser
ii)the stop() method of applet is called every time the user move to the another page
a. i is true ii is false
b. I is false ii is true
c. Both are true
d. Both are false
187.i)method getGraphics() use to obtain an object of the Graphics class
ii) virtual means existing in reality but not in effect
a. i is true ii is false
b. I is false ii is true
c. Both are true

Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

d. Both are false


188.i) An application does not require browser for execution
ii) Classes which does not have any objects is called abstract class
a. i is true ii is false
b. I is false ii is true
c. Both are true
d. Both are false
189. which of the following is overloading the function
int sum(int x,int y){ }
a)int sum(int x,int y,int z){ }
b)float sum(int x,int y){ }
c)int sum(int a,int b) { }
d)float sum(int x,int y float z) { }
190. i)byte is a data type occupies 2 byte memory
ii)a reference variable of a super class can be assigned a reference to any subclass derived from
that super class.
a. i is true ii is false
b. I is false ii is true
c. Both are true
d. Both are false
191. Virtual function allow us to
a. Create function that has no body
b. Use same function call to execute member functions of objects from different classes
a) a is true b is false
b) a is false b is true
c) Both are true
d) Both are false
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
B
C
A
B
A
B
A
D
B
D
B
D
B
C
C
C
A
B
C

PART B
(2 MARKS)
192. Describe JDBC.
JDBC allows programmers to connect to a data base, query it, or update it, using the Structured Query
Language (SQL). Programs developed with the Java programming language and JDBC are platform
independent and vendor independent.
193. Describe JDBC API.
The JDBC consist of two layers. The top layer is the JDBC API. This API communicates with the
JDBC manager driver API, sending it the various SQL statements. The manager should communicate with
the various third-party drivers that actually connect to the database and return the information from the query
or perform the action specified by the query.
194. Classify the JDBC drivers.
JDBC drivers are classified into the following types:
i) A type 1 driver translates JDBC to ODBC and relies on an ODBC driver to communicate with the
database.
ii) A type 2 driver, written partly in the Java programming language and partly in native code that
communicates with the client API of a database.

Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

iii) A type 3 driver is a pure Java client library that uses a database-independent protocol to
communicate database requests to a server component, which then translates the requests into a
database-specific protocol.
iv) A type 4 driver is a pure Java library that translates JDBC requests directly to a database-specific
protocol.
195. What are the options supported by the Java 2D API. (AU NOV/DEC 2011)
* We can easily produce a wide variety of shapes.
* We can control over the stroke.
* We can fill shapes with solid colors, varying hues, and repeating patterns.
* We can use transformations to move, scale, rotate, or stretch shapes.
We can clip shapes to restrict them to arbitrary areas.
196. Write some of the methods in the Graphics class to draw shapes:
i) drawLine
ii) drawRectangle
iii) drawRoundRect
iv) draw3DRect
v) drawPolygon
vi) drawPolyline
vii) drawOval
viii) drawArc

197. Describe simple property. (AU NOV DEC 2012)


A simple property is one that takes a single value such as a string or a number. The fileName
property of the ImageViewer is an example of a simple property.
198. Describe indexed property.
An indexed property is one that gets or sets an array. A chart bean would use an indexed property
for the data points. With an indexed property, we supply two pairs of get and set methods: one for the array
and one for individual entries.
199. Define virtual machine. (AU NOV DEC 2012)
A Java programming language compiler converts source into the machine language of a
hypothetical machine, called the virtual machine. The virtual machine code is stored in a class file with a
.class extension.
200. Define permission.
Permission is any property that is checked by a security manager. The JDK1.2 implementation
supports a number of permission classes, each of which encapsulates the details of a particular permission.
201. Describe thread. (AU NOV/DEC 2011)
Threads are lightweight process handling the connections instead of using heavyweight processes.
Whereas each separate process has its own block of memory, threads are easier on resources because
they share memory.
PART B
202. Write the differences between applet and applications.
203. How to include an applet in a HTML file?
204. What are the attributes of <APPLET> tag in HTML? Explain.
205. Distinguish between applet and servlet.
206. Explain the applet life cycle.

(16 MARKS)

Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

207. What is an applet? Explain how applets are used in net based applications.
208. Write an applet to display the institute name.
209. Design an applet to display your institutes name.
210. Discuss in detail the various methods in servlet to handle HTTP request and responses.
211. Explain the various methods defined by servlet request and servlet response interfaces?
212. Explain in detail the various components of JDBC? Give the steps for using JDBC to access a
data base.
213. Explain the life cycle of a servlet with various methods.
214. Write notes on:
i) Servlet APT
ii) Servlet life cycle
215. Write notes on:
i) Layout manager
ii) JDBC
216. Explain the architecture for servlets with a neat diagram. Illustrate each component of servlet.
(AU NOV DEC 2012)
217. Write short notes on:
i) Flow Layout
ii) Border Layout
iii) Grid Layout
iv) Card Layout
217. Explain the JDBC application architecture.
218. Design an applet to draw a traffic signal post with STOP, LISTEN and PROCEED signals.
219. Describe in detail about the multi tier application developments.
220. Describe the Java media framework.
221. Does RMI-IIOP support dynamic downloading for classes? (AU Nov/Dec 2010) (AU
NOV/DEC 2011)
222. Which method is called first when the JSP is requested? Mention its usage. (AU Nov/Dec 2010)
223. Explain the servlet utility classes in detail. (AU Nov/Dec 2010) (AU NOV/DEC 2011)
224. How does an applet running on a client machine send messages to a servlet running in the
server? Illustrate with an example. (AU Nov/Dec 2010)
UNIT V

ENTERPRISE APPLICATIONS
PART A
225.Polymorphism in java is implemented through ----------a) Virtual function
b) Function overloading
c) Both above
d) None of these
226.i) The BufferedInputStream class creates and maintains a buffer for an input stream.
ii) String object we are creating can be changed
A)Both i and ii true
B)i false and ii true
C)i true ii false
D)None
227..example of numeric constant
i.23000
ii.450.6
a) i is true
b)ii is true
c)both true d)none

Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

228. Example of character constant


i)SUM
ii) 9
a)i is true ii is false
b)i is false ii is true
c) Both i and ii is true
d)Both are false
229.relational operator are
i)&&
ii)++
a)i is true ii is false
b)i is false ii is true
c) Both i and ii is true
d)Both are false
230. Each case in switch statement should end with--------- statement
a)default
b)break
c)continue
d)none
231. ----------- is a highly optimized set of instructions designed to be executed by the Java
runtime system, which is called the -------------.
1. Bytecode, Java Virtual Machine
2. Data Code, Java machine
3. Source code, Microsystems
4. Bytecode ,Microsystems.
232.Two kinds of data types in java are __________and ___________
1. Primitive,standard
2. Primitive,Abstaract
3. abstract,derived
4. constants, variables
5.
233. Which of the following is not a java data type?
1. byte
2. register
3. long
4. nibble
5. int
6. char
1. 4 and 5 only
2. 1and 3 only
3. 5 and 6 only
4. 2 and 4 only
234.The _______ keyword is used to derive a class from a superclass.
The_________keyword is used to declare classes that define common properties and
behavior of other classes
1. Public ,friend
2. abstract ,extends ,
3. extends , abstract

Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

4. friend ,Public
235. A class can be declared as _______ if you do not want the class to be subclassed. Using the
__________keyword we can abstract a class interface from its implementation
1. protected ,interface
2. final,interface
3. public,friend
4. final,protected
236.The term exception denotes an ________ event .Java handles exceptions the
______________ way.
1. exceptional ,object-oriented
2. traditional, object-oriented
3. exceptional, procedural
4. friend ,Public
237. Identify the situations in which an null exception is NOT thrown
1. Using an object without allocating memory for it.
2. Calling the methods of a null object.
3. Accessing or modifying the attributes of a null object.
4. Attempt to access an array element beyond the index of the array
1. 1
2. 3
3. 4
4. 2
238. The two major classes for byte streams are _______ and _______
1. Input,Output.
2. byteStream,bitStream.
3. InputStream,OutputStream.
4. stringStream,stingStream.
239. The ________ and _________ classes are filter streams that allow the reading and Writing
of Java primitive data types.
1. InputStream, OutputStream
2. DataInputStream, DataOutputStream
3. Input,Output.
4. byteStream,bitStream.
240. Which of the following method does not belong to graphics class?
a. Text
b. pixel
c. Lines
d. Circle and ellipse.
241. To establish a connection with a database, you need to register the ODBC-JDBC Driver by
calling the __________ method from the Class class and then calling the ________ method
from the DriverManager class.
1. getConnection (),forName ()
2. for () , get ()
3. get (), for () ,
4. forName (), getConnection ()
242.In the init(ServletConfig) method of Servlet life cycle, what method can be used to access
the ServletConfig object ?
(a) getServletInfo()
(b) getInitParameters()
(c) getServletConfig()

Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

(d) none of these


243. The __________ is used to handle the errors that may occur during the invocation of a
Remote method. Remote Method Invocation uses _________Protocol
1. Interface,TCP
2. Exception,TCP
3. Exception,UDP
4. Interface,UDP
244. Arrange the following steps to complete a request and response in a typical web application
1. Send a request to the web server.
2. Web application will collect data from the user. (First tier)
3. Send it back to the browser for display. (First tier)
4. Run the requested server program. (Second and third tier)
5. Package up the data to be presented in the web browser.
1. 1-2-5-3-4
2. 2-1-4-5-3
3. 2-1-3-4-5
4. 1-2-4-5-3

226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
C
C
B
D
B
A
B
D
C
B
A
C
C
A
B
D
C
B
B

PART B
(2 MARKS)
245. When we use execute query () and executeupdate () methods of the statement object?
The execute query () method is used to execute the SQL statements that return a result set object. The
executeupdate () method is used to execute the SQL statements that manipulate data.
246.What is forname () method used for?
The forname () method is a static method present in the class. It is used to load the specified class at run time
and returns the class descriptor.
247. What is the difference between an applet and a Java bean? (AU NOV/DEC 2011)
The main distinguishing features of a Java bean are customization, introspection and persistence.
248.What is Glasgow?
It is the code name for the next release of JavaBeans component model specification.
249. What is bean? (AU NOV DEC 2012)
A bean is a reusable and a self-contained software component.
250. What are the types of Java beans?
Three types of beans:
i)
Control beans ii)Container beans iii)Invisible run time beans
251. What is the use of driver manager class?
The driver manager class is used to establish a connection with a data base.
252.What is executing query ()?
The execute query () method executes a simple select query and returns a result set object.
253. What is executing update ()?
The execute update () method executes an SQLINSERT, UPDATE or DELETE statement and returns
an int value specifying the number of rows affected by the query or () if the query does not return any value.

Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

254. What is mean by getconnection()?


The getconnection () method from the driver manager class is used to establish a connection with a data
base. This method attempts to locate the driver that can connect to the data base represented by the JDBC
URL passed to the getconnection () method.
255. Write about J2EE. (AU NOV/DEC 2011)
The mission of J2EE is to provide a platform-independent, portable, multiuser, secure and standard
enterprise class platform for server-side deployments written in the Java language.
256. What is a session bean?(AU NOV DEC 2012)
A session bean is a relatively short-lived component. It has roughly the lifetime equivalent of a session or
lifetime of the client code that is calling the session bean.
256. What is a stateful session bean? (AU NOV DEC 2012)
A stateful session bean is a bean that is designed to service business processes that span multiple method
requests or transactions. To accomplish this, stateful session beans retain state on behalf of an individual
client.
257. What is a stateless session bean? (AU NOV DEC 2012)
A stateless session bean is a bean that holds conversations that span a single method call. They are
stateless because they do not hold multihomed conversations with their clients.
258. Define passivation.
To limit the number of stateful session bean instances in memory, the container can swap out a stateful
bean, saving its conversational state to a hard disk or other storage. This is called passivation.
259. Define activation.
After passivating a stateful bean, the conversational state is safely stored away, allowing resources
like memory to be reclaimed. When the original client invokes a method, the passivated conversational
state is swapped in to a bean. This is called activation.
260. What is an entity bean?
Entity beans are persistent objects that can be stored in permanent storage. This means that we can
model our business fundamental, underlying data as entity beans.
261. What is an object-relational mapping?
The mapping of objects to relational databases is a technology called object-relational mapping. It is the
act of converting and unconverting in-memory objects to relational data.
262. Define ODBMS and OQL.
An object database management system is a persistent store that holds entire objects.
An object query language is a nice high-level interface that allows query object properties for arbitrary
characteristics. It also adds a layer of abstraction from relational database queries.
263. Define transaction.(AU NOV DEC 2011)
A transaction is a series of operations that appear to execute as one large, atomic operation. It allows
multiple users to share the same data and guarantee that any set of data they update will be completely
and wholly written, with no interleaving of updates from other clients.
264. What is a flat transaction?
A flat transaction is the simplest transactional model to understand. A flat transaction is a series of
operations that are performed atomically as a single unit of work. After a flat transaction begins, our
application can perform any number of operations. Some may be persistent operations, and some may
not.
PART B
(16 MARKS)
Ms.B.NIRMALA ASST.PROFESSOR/CSE

QUESTION BANK

III - CSE

265. Explain in detail the server side component architecture with a neat diagram. (AU NOV/DEC
2011)
266. What is J2EE? How is it used in networking?
267. Explain in detail about the J2EE and its features. (AU NOV/DEC 2011) (AU NOV DEC 2012)
268. What is meant by session bean? What are the steps followed in writing a session bean?various
method in it. (AU NOV DEC 2012)
269. Briefly explain about the entity beans and itd adv and disadvantage. (AU NOV DEC 2012)
270. Explain in detail about the persistent entity beans.
271. Write a Java program to use the Java beans.
272. Write a Java program to find the factorials of n numbers.
273. Explain the transactions.
274. What is Java bean? List the steps to create a new bean.
275. Explain the characteristics of stateful session beans. (AU NOV/DEC 2011)
276. What is EJB container? (AU Nov/Dec 2010)
277. What is durable subscription in a JMS? (AU Nov/Dec 2010)
278. Describe the components of a JMS program in detail. (AU Nov/Dec 2010)
279. Explain the use of RMI in a transportation company in which the server has the details of items
transported and the movement can be monitored from any client machine. (AU Nov/Dec 2010)

Ms.B.NIRMALA ASST.PROFESSOR/CSE

You might also like