277-a - St.Joseph's College

advertisement
CLASS: B. Voc. Software Development & System Administration
15N /277
St. JOSEPH’S COLLEGE (AUTONOMOUS) TIRUCHIRAPPALLI – 620 002
SEMESTER EXAMINATIONS – NOVEMBER 2015
TIME: 3 Hrs.
MAXIMUM MARKS: 100
SEM
SET
PAPER CODE
TITLE OF THE PAPER
III
2014
14USS330210
JAVA PROGRAMMING
SECTION – A
Answer all the questions:
20 x 1 = 20
Choose the correct answer:
1. Which is a valid keyword in java?
a) Interface
b) String
c) Float
d) unsigned
2. Which one of the following will declare an array and initialize it
with five numbers?
a) Array a = new Array(5);
b) int [] a = {23,22,21,20,19};
c) int a [] = new int[5];
d) int [5] array;
3. class exception_handling {
public static void main(String args[]) {
try { int a = args.length; int b = 10 / a;
System.out.print(a);
try { if (a == 1)
a = a / a - a;
if (a == 2) { int c = {1}; c[8] = 9; }
}
catch (ArrayIndexOutOfBoundException e) {
System.out.println("TypeA"); }
catch (ArithmeticException e) {
System.out.println("TypeB"); }
}
} }
a) TypeA
b) TypeB
c) 0TypeA
d) 0TypeB
4. Which of this class is related to all the exceptions that are explicitly
thrown?
a) Error
b) Exception
c) Throwable
d) Throw
5. ____ method can be used to output a string in an applet.
a) display()
b) print()
c) drawString()
d) transient()
Fill in the blanks:
6.
________is the return type of a method that does not returns any
value.
7.
________ of a class can define their own unique behaviors and yet
share some of the same functionality of the parent class.
8.
________ class is used to create servers that listen for either local
or remote client programs.
9.
________ event is activated if the user close the applet window.
10. ________ exception can be thrown when an application tries to
open a file for writing.
State True or False:
11. Function overriding is the process of defining more than one
method in a class differentiated by method signature.
12. In Java, 'super' keyword can be used to refer superclass instance in
a subclass.
13. java.rmi package is used for remote method invocation.
14. JDialog class is used to create the custom dialog.
15. Runnable is an interface, which helps to create a thread.
Match the following:
16. Final Method
- a) Database Connectivity
17. Abstract classes
- b) Static variables
18. Instance variables
- c) Declared in a class
19. Class variables
- d) Cannot be instantiated
20. JDBC
- e) Method cannot be overridden by subclasses
SECTION – B
Answer all the questions:
5 x 4= 20
21. a. Explain the various conditional statements in JAVA.
OR
b. Explain the constructor overloading concept its usage.
22. a. Write a note on finalize Method.
OR
b. Give an account on static member and static method.
23. a. Explain the concept of final class. Give an example.
OR
b. What are the methods related to the Mouse Events?
24. a. Explain the exception handling features of Java.
OR
b. Explain the concept of synchronization concept in thread.
25. a. Explain the concept of reader and writer stream.
OR
b. Explain the concept UDP socket and datagram packet class.
SECTION – C
Answer any FOUR questions:
4 x 15 = 60
26. Write a Java program to display the student information using the
following data members such as dno, name, class and marks
(Using the concept of classes and object).
27. Write a java program to create the emp class with following
information such as empno, empname, date of birth and create
another salary class with following information such as basic pay,
da, hra,cca,lic. Use the concept of inheritance and display the
salary information.
28. Write a java program to display the traffic light using Applet.
29. (a) Explain the concept of thread life cycle.
(b) Explain the inter-thread communication.
30. Write a java program to create a table for student information and
do the following operation using database:
a) Insert
b) Delete
c) Update.
**************
Download