Sei sulla pagina 1di 2

P13CS663 Page No...

1
U.S.N

P.E.S. College of Engineering, Mandya - 571 401


(An Autonomous Institution affiliated to VTU, Belgaum)
Sixth Semester, B.E. – Computer Science and Engineering
Make-up Examination; Jan / Feb - 2017
Java and J2EE
Time: 3 hrs Max. Marks: 100
Note: Answer FIVE full questions, selecting ONE full question from each unit.
UNIT - I
1 a. How “Compile once and run anywhere” is implemented in Java language? 4
b. What is meant by instance variable hiding? How to overcome it? 4
c. What is super? Explain the use of super with suitable example. 6
d. Write a program in Java to demonstrate the nested try statements. 6
2 a. What is Java virtual machine? Explain buzzwords in Java. 10
b. Define dynamic method dispatch. Write a Java program to illustrate dynamic method
6
dispatch.
c. Create enum “Snacks” with 3 constants CHOCHOLATE (200), COOKIES (50),
ICECREAM (100) where attribute value indicates calories of snacks. Define a method
4
getCalories (int) that returns the attribute value of enum constants. Write a Java program to
display Calories of each snack.
UNIT - II
3 a. Why is main thread important? Write a Java program that creates child thread and also
10
ensures that the main thread is the last thread to stop.
b. What is the use of InetAddress class? Write a Java program to demonstrate InetAddress
6
class.
c. Illustrate with an example program how generics improve type safety? 4
4 a. Define multithreaded programming. Explain with an example how inter thread
10
communication is implemented in Java?
b. Define Datagram socket and Datagram Packet along with constructors. 4
c. List and explain with example, the restrictions that need to keep when using generics. 6
UNIT - III
5 a. Explain different interfaced defined by collection framework. 10
b. Write a Java applet which continuously plays an audio clip named ‘anthem.wav’ loaded
4
from applets parent directory. Provide the necessary HTML file to run-this applet.

Contd…2
P13CS663 Page No... 2
c. Briefly explain the role of :
i) Action event class 6
ii) Adjustment event class.
6 a. Write a Java program that uses a comparator to sort accounts by last name. 6
b. Write a program to create an applet that scrolls a text message. 4
c. Write a program using an applet which will print “Key pressed” on the status window when
you press the key, “key released” on the status window, when you release the key, and when 10
you type the characters it should print “Hello” at coordinates (50, 50) on applet.
UNIT – IV
7 a. Describe the various steps of JDBC process with code snippets. 8
b. Explain the lifecycle of Servlet. 6
c. With a code snippet, explain how session tracking is handled in Java with Servlets. 6
8 a. What are database drivers? Mention different types of drivers used in JDBC. 4
b. How a J2EE component can make a connection to database? With Syntax explain the
6
different getconnection methods.
c. Write a program using Servlet which contains HTML page to accept username and display
10
greeting message “Hello username, How are u” in the browser window.
UNIT - V
9 a. Define JSP. Explain the two types of control statements used in JSP by taking suitable
6
examples.
b. Write a server side and client side programs to simulate an RMI. 8
c. Describe the functions of EJB transaction attributes. 6
10 a. Write a JSP to create and read cookie named userid that stores the value JB0007. 5
b. Define entity Java bean. Write and explain the skeleton of entity Java bean. 8
c. With the help of diagram, explain the relationship in EJB environment. 7

***

Potrebbero piacerti anche