Core and Adv Java

barristerbedroomSoftware and s/w Development

Oct 28, 2013 (3 years and 7 months ago)

88 views

Roll No. …………………..


Li ngaya’ s Uni ve rs i t y

MCA. 1
s t

Year ( Term
-
I I
I )

End
-

Te rm Exami nat i on


May
-

2 0 1 2

Core and Adv Java

(
CA



206
)


[Time: 3 Hours]


[Max. Marks: 100]


Before answering the question, candidate

should ensure that they have been
supplied the correct and complete question paper. No complaint in this regard
will be entertained after examination.


Note:


Attempt five questions in all. All questions carry equal marks.
Question No. 1 (Section A) is
compulsory. Select any four questions from
Section B.

Section


A


Q.
I Multiple answer type question:
-





[10
X
2]

(
i
)
.

Which of the following are Java reserved words?

1.

run



2.
import

3.
default

4.

implement

(
a)1 and 3
(
b) 1 and 2
(
c)1 and 4
(
d) 2 and 4

(
ii)

public

class

foo

{


public

static

void

main(String[]args)
throws

Exception {


java.io.PrintWriter out =
new

java.io.PrintWriter();


new

java.io.OutputStreamWriter(System.out,
true
);


out.println(
"Hello"
); }


}

which of the statements included to run
this code

(
a) no statement required

(
b) import java.io.*

(
c) include java.io.*



(
d) import java.io.PrintWriter

(
iii)


How can you execute a stored procedure

in the database?


(a) Ca
e
ll method
execute()
on a CallableStatement object




(b) Call method
executeProcedure()
on a Statement object




(c) Call method
execute()
on a StoredProcedure object




(d) Call method
run()
on a ProcedureCommand obj
ect

(
iv)

class Test {



static


{

int x=3;


System.out.println("test:" + " " + (x+3));

}



}

write the
O/P:

(
v)

Which one of the following is a valid declaration of an applet?


(
a)

public class MyApplet extends Applet {


(
b)

public Applet MyApplet {


(
c)

public class MyApplet extends applet implements Runnable {


(
d) Abstract class MyApplet extends java.applet
.Applet{


(
vi) Which method is not defined in the String class

(
a) trim( )
(
b) length
(
c) concat(String )
(
d) hashCode( )

(
e) reverse()

(
vii)

A servlet maintain session in

(
a)

Servlet container



(
b)

Servlet request heap


(
c)

Servlet response heap


(
d)Servlet

c
ontext


(
viii)
What is the limit of data to be passed from HTML when doGet()
method is used
?

(a
)
4K

(
b) 8K


(
c)

2K


(
d) 1K

(
ix)
Which of the following methods is overridden by Action class
?

(a)
execute(

)

(
b)
service(

)


(
c) run( )


(
d)destroy( )

(
x)
What are implicit objects in JSP

(
a) request

(
b)

pageContext


(
c)session

(
d)
All of the above


Q
-
1
A

(i)

What is the difference between overloading and overriding of
a method








(5)

(
ii
) E
xplain the s
tatic

variables

and static methods

in Java


(5)


SECTION


B


Q
-
2

(
a)
Is

it possible overload constructor? Why would it be done?
Explain with example






(10)

(
b) Write a program that accepts 5 strings as input and prints those
strings as output which

consists of at

least one vowel.



(
1
0)

Q3
.
(
a)

Explain the difference b
etween AWT and Swing? Why do you
prefer using Swing over AWT?





(10)

(
b) What is RMI? Differentiate

between stubs and skeletons with their
usage








(10)

Q4



(
a) What
is multi threading? Explain the life cycle of a thread.

(10)

(
b)
W
hat are the steps involved for making a connection with
database? Explain with suitable example to retrieve all the records
from a table








(10)

Q
5

(
a) Write a program for I/O operation using buffered input stream
and Buffered output

stream that
accepts username age and address
from the user and displays it on

the console.




(10)

(
b) Differentiate between inner and nested classes with an example.









(10)

Q
6)

(
i)

Explain session tracking in servlet
.
Explain any
two methods of
session tracking
.

List atleast three methods of HTTPSession.


(10)

(
ii)

Differentiate among the following






(6)

(a)
doGet and doPost

(b)
ServletConfig interface and the ServletContext interface

(
iii)

Give steps to create simple servlet

and also write program to
demonstrate.









(4)

Q7)

(
i)

Write a program using JSP Tags to compute factorial number
from 1 to 5.








(5)

(
ii)
Discuss vari
ous implicit objects of the JSP

What is the scope of these
objects?








(7)

(
iii)
Write short notes on







(8)

(a)
Synchronization issues in JSP

(b)
JSP Access models

Q8)

(
i)

What are the components of struts? Explain the MVC
Architecture.







(6)

(
ii)

What is ActionForm

in struts? What are different methods in
ActionForms? Describe each in detail.





(7)

(
iii)
What is the directory structure of struts application.




(2)

iv)
What are different actions in struts . Explain each action in detail.











(5)