VTU Previous Year Question Papers BE CS Seventh Semester Java and J2EE July 2011

VTU Previous Year Question Papers BE CS Seventh Semester

Java and J2EE July 2011



1 a. class Example {

Public static void main (String s[ ]) {

int a;

for (a = 0; a < 3; a++) {

int b = -1;

system.out.println (“   ”+b ) ;

b =50;

system.out.println (“   ”+b ) ;




What is the output of the above code? If you insert another ‘int b’ outside the for loop What is the output?

b. With example explain the working of >>and >>>.

c. What is the default Package and default class in Java?

d. Write a program to calculate the average among the elements ( 4,5,7,8,) using for each in Java. How for each is different from for loop?


2 a. With example, give two uses of super.

b. Write a program which contains one method which will throw illegal Access Exception and use Proper exception handlers so that exceptions should be printed.

c. What are the two type of applet? Explain the Skeleton of an applet. Enlist applet tags.

d. Give the Different Forms of repaint method.


3  a. With syntax, Explain use of is Alive () and join () methods.

b. How synchronization can be achieved for threads in java. Explain with syntax.

c. Enlist the Different method window Listener. What is the use of window adapter.

d. 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 released the key and when you type the character it should print “Hello” at co-ordinates (50, 50) on applet.


4 a. How AWT is different from swings? What are the two Key features of it? Explain.

b. List four type of Buttons is swings with their use. Write a program create four different type of buttons on JApplet. Use suitable to show actions on the buttons and use JLabel to display the actions invoked.



5  a. Give an overview of the JDBC process.

b.   With proper syntax, explain three types of get Connection method.

c.    Explain the scrollable result set with an example.


6  a. How servlets are better in comparison with CGI? Explain init() and service().

b. Enlist core classes and interfaces available in javax.servlet.http package.

c.    Write a program using servlet which contains HTML page with various color options. When user choose 8 the particular color, the background of that page should be changed accordingly.  •


7 a. Discuss different types of JSP tags.

b. Department has set the grade for the subject Java as follows:

Above 90 = A,      80-89 = B,            70-79 = C,       Below 70 = fail.

Sham enters his marks for the subject Java in the interface provided. Write a JSP program to accept the marks entered and display his grade to the browser.

c.    Briefly explain how Remote Method Invocation works in Java.


8 a. Explain the various EJB transaction attributes.

b. Write a code skeleton of a session bean.

e. Why message-driven bean is designed? Explain four methods of it.

Leave a Comment