West Bengal Institute of Technology (WBIT) 2008-6th Sem B.C.A Computer Application - E602B Object Oreiented Programming with Java ( ) - Question Paper
2008
CS/BCA/SEM-6/BCAE602B/2008
OBJECT ORIENTED PROGRAMMING WITH JAVA
Time Allotted: 3 Hours
Full Marks 70
The figures in the margin indicate full marks.
Candidate are required to give their answers in their own words as far as practicable.
GROUP-A (Multiple Choice Type Question)
1. Choose the correct alternatives for the following :
10 x 1 = 10
int i = 2 ;
System.out.println ("welcome"+l+2); The Output is :
b) welcomel2
a) welcome3
ii) intx = 2; for (x = 0; x <5; x++) System, out. println(x); The output is a) 012 34 C) 234 iii) String a = "3"; System, out.println(a); The output is a) 3 c) compiler error |
d) None of these. b) 1 2 3 4 d) none of these. b) a d) runtime exception |
iv) int a = 2;
for (:a<5: a++)
System, out.println(a);
The output is a) compiler error
b) runtime exception d) 2 34
c) infinite loop
v) int arr [] = new int[3]; arr[3] = 7;
System, out. println(arr[3]);
The output is a) 3
b) 7
d) runtime exception
c) compiler error
vi) In java applet, Stop() method can be invoked for a thread
a) once
b) twice d) not at all.
c) compiler error
vii) Dynamic method dispatcher is used for
a) resolving method overriding
b) resolving multilevel inheritance
c) resolving multiple inheritance anomally
d) none of these.
viii) JVM stands for
a) Java Virtual Machine
b) Java Visual Machine
c) Java Vision Machine
d) None of these.
ix) String s = "WBUT"
System.out.println(s.charAt(2));
The output is
a) U b) Exception occurs c) 2 d) B.
x) What is the return type of read () method of InputStream class ?
a) String b)Void c) Float d) None of these.
xi) Consider the following statements :
int a = 10, b = 15; a = (a<b) ? (b+a): (b-a): what will be the value of a after executing these statements ?
a) 10 b) 25 c) 15 d) 5.
xii) Which of the following statement is true regarding constructors ?
a) All cases must be define as a constructor
b) A constructor can be defined private
c) A constructor can return a value
d) A constructor must initialize all the fields of a class.
GROUP-B (Short Answer Type Question)
Answer any three of the following. 3x5 = 15
2. What do you mean by object oriented programming ? How it differs from conventional procedural Programming ? 2 + 3
3. What is Wrapper Class ? What is the utility of final keyword ? 2 + 3
4. What are the differences between method overloading and method overriding ? Give
Example for both. 5
5. What do you mean by interface ? Write the difference between interface and abstract class. 2 + 3
6. Describe the difference string functions.
GROUP-C (Long Answer Type Question)
Answer any three of the following. 3 x 15 = 45
7. a) Write a program in JAVA to reverse a string.
b) Write a program in JAVA to input a number from the command line & find whether it is Prime or not. 7.5+ 7.5
8. What is applet ? Describe an Applet life cycle. Develop an Applet that receives three numeric values As input from the user and then displays the largest of the three on the screen , also write the HTMI code. 1 + 3 + 8 + 3
9. What is thread ? How do we set the priorities for thread ? Describe with an example . Write a
Small program which will synchronize among two threads.
2 + 8 + 5
10. a) Describe the structure of typical Java program.
b) What do you mean by method overloading ? Explain with example ,
c) Write a java program to find out the sum of harmonic series :
1 + >2 + 1/3 +.........up to nth term , for any value of n.
4 + 3 + 8
5 + 6 + 4
11. a) Discuss the lifecycle of thread .
b) Write a small program with output to show thread .
c) What do we mean by thread priority ?
Edit by suffKrajyoti
Attachment: |
Earning: Approval pending. |