Solapur University Question Paper
M.C.A. II (Semester – IV) (Commerce) Examination, 2014
JAVA PROGRAMMING
Day and Date : Monday, 5-5-2014 Max. Marks : 70
Time : 3.00 p.m. to 6.00 p.m.
Instructions: 1) Q. No. 1 and 7 are compulsory.
2) Solve any two questions from Q. No. 2, 3 and 4. Solve any
one question from Q. No. 5 and 6.
3) Figure to the right indicates marks to a question or sub
question.
1. A) Choose the correct alternative : 6
1) Interface cannot be extended
a) True b) False
2) Import statement is always the first non-comment statement in java program
file.
a) True b) False
3) The default layout of Frame is _______
a) GridLayout b) FlowLayout
c) BorderLayout d) GridBagLayout
4) A catch clause may catch exceptions of which type ?
a) Throwable b) Exception
c) Error d) String Type
5) ___________ is a drawback of Multithreading.
a) Race condition b) Deadlock condition
c) Starvation d) a, b & c
6) ______________ is a process by which a primitive type is automatically
Encapsulated into its equivalent type wrapper.
a) Auto boxing b) Auto Unboxing
c) Both a & b d) None
Seat
No.
SLR-GL – 26 -2-
B) Identify the output of the following snippets (any 2) : 4
1) String s = “Java is cool.”;
StringTokenizer t = new StringTokenizer (s, “ac”);
System.out.printIn (“The total number of tokens is” + t.countTokens ( ) ) ;
while (t.hasMoreTokens ( ) )
System.out.printIn (t.nextToken ( ) ) ;
2) public class AIDemo extends Applet {
public void init ( ) {
addMouseListener (new MouseAdapter ( ) {
public void mousePressed (MouseEvent me) {
showStatus (“Mouse Pressed”) ;
}
} ) ;
}
}
3)
try
{
int x = 0 ;
int y = 5 / x ;
}
catch (Exception a)
{
System.out.printIn (“Exception”) ;
}
catch (ArithmeticException ae)
{
System.out.printIn (“Arithmetic Exception”) ;
}
System.out.printIn (“finished”) ;
-3- SLR-GL – 26
C) Answer in 1-2 sentences : 4
i) What will happen, if main ( ) function is defined as private ?
ii) What is a Class Path ?
iii) What kind of thread is the Garbage collector thread ?
iv) Define Socket and state 2 important socket classes.
2. Attempt the following : (2×7)
i) What is an applet ? How do Applets differ from Applications ?
ii) Explain Serialization. Write a java program to append the contents of the file
“a1.txt” to “a2.txt”.
3. Attempt the following : (2×7)
i) Explain thread Synchronization with example.
ii) What is EJB ? Explain different types of EJB in detail.
4. Attempt the following :
i) Write java socket program that runs on a server and echos back all the string
sent by a client. If the client send a string ‘Exit’, the server program should
terminate. Use port number 60000. (2×7)
ii) Explain steps involved in RMI application with example.
5. Write a GUI based program to enter the roll no in the textbox and view all the
details like name, address, contact no, date_of_birth on the other text boxes.
(Retrieve values from database using JDBC). (1×14)
6. Write a java program that display Text field where user can type file name. When
file name is entered, the program should check whether file exists. If it does not,
an error message should be flashed on the screen. And if it is, then it should
display contents of the file in the text area. (1×14)
7. Short notes any 2 :
a) Layout Managers
b) JDBC drivers
c) Thread Life cycle
d) Delegation Event Model in Java. (2×14)
———————
M.C.A. II (Semester – IV) (Commerce) Examination, 2014
JAVA PROGRAMMING
Day and Date : Monday, 5-5-2014 Max. Marks : 70
Time : 3.00 p.m. to 6.00 p.m.
Instructions: 1) Q. No. 1 and 7 are compulsory.
2) Solve any two questions from Q. No. 2, 3 and 4. Solve any
one question from Q. No. 5 and 6.
3) Figure to the right indicates marks to a question or sub
question.
1. A) Choose the correct alternative : 6
1) Interface cannot be extended
a) True b) False
2) Import statement is always the first non-comment statement in java program
file.
a) True b) False
3) The default layout of Frame is _______
a) GridLayout b) FlowLayout
c) BorderLayout d) GridBagLayout
4) A catch clause may catch exceptions of which type ?
a) Throwable b) Exception
c) Error d) String Type
5) ___________ is a drawback of Multithreading.
a) Race condition b) Deadlock condition
c) Starvation d) a, b & c
6) ______________ is a process by which a primitive type is automatically
Encapsulated into its equivalent type wrapper.
a) Auto boxing b) Auto Unboxing
c) Both a & b d) None
Seat
No.
SLR-GL – 26 -2-
B) Identify the output of the following snippets (any 2) : 4
1) String s = “Java is cool.”;
StringTokenizer t = new StringTokenizer (s, “ac”);
System.out.printIn (“The total number of tokens is” + t.countTokens ( ) ) ;
while (t.hasMoreTokens ( ) )
System.out.printIn (t.nextToken ( ) ) ;
2) public class AIDemo extends Applet {
public void init ( ) {
addMouseListener (new MouseAdapter ( ) {
public void mousePressed (MouseEvent me) {
showStatus (“Mouse Pressed”) ;
}
} ) ;
}
}
3)
try
{
int x = 0 ;
int y = 5 / x ;
}
catch (Exception a)
{
System.out.printIn (“Exception”) ;
}
catch (ArithmeticException ae)
{
System.out.printIn (“Arithmetic Exception”) ;
}
System.out.printIn (“finished”) ;
-3- SLR-GL – 26
C) Answer in 1-2 sentences : 4
i) What will happen, if main ( ) function is defined as private ?
ii) What is a Class Path ?
iii) What kind of thread is the Garbage collector thread ?
iv) Define Socket and state 2 important socket classes.
2. Attempt the following : (2×7)
i) What is an applet ? How do Applets differ from Applications ?
ii) Explain Serialization. Write a java program to append the contents of the file
“a1.txt” to “a2.txt”.
3. Attempt the following : (2×7)
i) Explain thread Synchronization with example.
ii) What is EJB ? Explain different types of EJB in detail.
4. Attempt the following :
i) Write java socket program that runs on a server and echos back all the string
sent by a client. If the client send a string ‘Exit’, the server program should
terminate. Use port number 60000. (2×7)
ii) Explain steps involved in RMI application with example.
5. Write a GUI based program to enter the roll no in the textbox and view all the
details like name, address, contact no, date_of_birth on the other text boxes.
(Retrieve values from database using JDBC). (1×14)
6. Write a java program that display Text field where user can type file name. When
file name is entered, the program should check whether file exists. If it does not,
an error message should be flashed on the screen. And if it is, then it should
display contents of the file in the text area. (1×14)
7. Short notes any 2 :
a) Layout Managers
b) JDBC drivers
c) Thread Life cycle
d) Delegation Event Model in Java. (2×14)
———————
0 comments:
Pen down your valuable important comments below