Page 1 of 3
[Link]
BCA 3rd SEMESTER EXAM. , 2014
JAVA PROGRAMMING CODE- 303303
Time: 3 hours Full Marks: 60
Instructions:
i. The Marks are indicated in the right -hand margin.
ii. There are SEVEN questions in this paper.
iii. Attempts FIVE question in all.
iv. Question Nos. 1 and 2 are compulsory.
1. Choose the correct one / Answer question of the following (any six). 2*6=12
(a) A methods in an abstract class must be declared abstract.
(I) True (II) False
(b) What is the value of Y in a given program segment?
Int a=5; int b=6; Y= b++ + ++a; [Link](Y);
(c) If m and n are int type variables, what will be the result of the expression m%n,
When m= -14 and n= -3 ?
(I) 4 (II) 2
(III) -2 (IV) None of the above
(d) Which of the following statement is valid array declaration?
(I) int x (); (II) float y[];
(III) double [] z; (IV) t int[];
(e) The methods wait () and notify () are defined in
(I) Java. [Link] (II) Java. [Link]
(III) Java. [Link] (IV) Java. [Link]
(V) Java. [Link] Group
(f) Given the following code:
Class ABC {int x=10; }
Class PQR extends ABC { int x=20; }
ABC b=new ABC ();
PQR d=new PQR ();
[Link] ABC bd= new PQR ();
Page 2 of 3
[Link]
The statement -
[Link](b.x+” ”+d.x+” ”+bd.x);
Will produce the output
(I) 10 20 20 (II) 10 20 10
(III) 20 10 20 (IV) 20 20 10
(g) The set BackGround () method is part of the class
(I) Graphics (II) Applet
(III) Component (IV) Container (V) Object
(h) When we implement the runnable interface, we must define the method
(I) start () (II) init ()
(III) run () (IV) runnable ()
(V) resume () (VI) main ()
(i) Which of the following keyword is used to control access to a member?
(I) default (II) abstract
(III) protected (IV) interface (V) public
(j) Which of the following will produce a value of 10, if x=9.7?
(I) floor (x) (II) abs(x)
(III) rint (x) (IV) round(x) (V) ceil ()
2. Answer any three of the following: 4*3=12
(a) How is Java strongly associated with the internet?
(b) What is empty statement? Explain its usefulness?
(c) What is constructor? What are its special properties?
(d) What is vector? How is it different from an array?
(e) How do we tell Java that we want to use a particular package in a file?
Answer any three of the following: 12*3=36
3. What is the significance of’ super’ keyword in an inheritance? Explain with an example how
Subclass class can superclass constructor and how super keyword can access superclass
member.
[Link]
Page 3 of 3
[Link]
4. What is static import? How is it useful? Using package access and importing packages
Technique, write a program to find the largest among three numbers.
5. Describe the compete life cycle of a thread. Write a program to illustrate implementing the
runnable Interface
6. Explain how to rethrow an exception. Write a program to create a try block that is likely to
generate three types of exception and then incorporate necessary catch blocks to catch
and handle the appropriately .
7. Write down the methods defined by input stream. Write a java program that demonstrates
random access I/O which writes six double to a file and then reads them back in non-
sequential order.
[Link]