WBUT or West Bengal university of technology is conducted MCA along with various technical courses. According to their MCA syllabus, students learn JAVA in the 5th semester. We are trying to give some guidance to the WBUT students by previous year solved papers. Here we discuss the Java paper of 2011.
Time Allotted: 3 Hours Full Marks: 70
The figures in the margin indicate full marks. Candidates are required to give their answers in their own words as far as practicable.
( Multiple Choice Type Questions )
1. Choose the correct alternatives for the following : 10 × 1 = 10
i) What is the result of attempting to compile and run the program ?
public class Test
public static void print(Integer arg)
public void print(int arg)
public static void main(String arg)
}//end of main
}//end of test class
a) int b) integer
c) compilation error d) none of these.
ii) What will be the output ?
public class Ques
private int i;
public Ques incre()
return new Ques();
public void show()
public static void main(Stringargs)
Ques Q1 = new Ques();
a) i = 2 b) i = 3
c) compilation error d) i = 0.
iii) int i = “hello” ; what type of exception java throws ?
a) IllegalArgumentException b) NumberFormatException
c) IntegertoStringCastingException d) CastingException.
iv) The method used in Java which waits for the thread to die is
a) wait( ) b) destroy( )
c) die( ) d) join( )
v) Which code declares class B belong to the package1.mypackage
a) package package1 ; package mypackage b) import package1.* ;
c) package package1.mypackage.B ; d) package package1.mypackage ;
vi) Consider the following statements :
int a=15, b=20;
What will be the value of aafter executing these statements ?
a) 10 b) 25
c) 15 d) 5
e) error, cannot be executed.
vii) Multiple inheritance is implemented in Java by
a) extending two or more classes
b) extending one class and implementing one or more interfaces
c) implementing two or more interfaces
d) all of these.
viii) Difference between String and StringBuffer class is
a) String object can be extendable but StringBuffer object cannot be extendable
b) String object can be extendable but StringBuffer object can be expandable
c) both are same
d) none of these.
ix) What is immediate superclass of applet class ?
a) Panel b) Object
c) Interface d) None of these.
x) super() is used to
a) access superclass constructor within subclass constructor
b) access superclass method within subclass constructor
c) both (a) and (b)
d) none of these.
GROUP – B
( Short Answer Type Questions )
Answer any three of the following. 3X5 = 15
2. Create an array that holds the integer, string, double information.
3. What is the checked and unchecked exception ? Explain with proper examples.
4. What is JVM ? Java is platform-independent language. -Explain. 2 + 3
5. What is polymorphism ? What are the types of polymorphism ?2 + 3
6. What is threading ? Explain how you can synchronize multiple threads in Java ?
( Long Answer Type Questions )
Answer any threeof the following. 3X15 = 45
7. a) Write a program that takes a file name and a search string from the user. If the search string occurs in the file, then it counts the number of occurrences of the string. ( Assume that search pattern can exist more than two times in a line ).
b) How to call a constructor from another one ?
c) If we define the constructor in the private section then how can we create an object of that class ?
d) “In Java the variables are initialized before any method called even constructor.” Explain with an example. 8 + 2 + 2 + 3
8. a) Write a program that stores information in the array and then sort the array.
b) What is the difference between the character stream and byte stream ?
c) How does Java garbage collector work ?
d) What is the object serialization in Java ? Illustrate with an example. 4 + 3 + 3 + 5
9. a) What is the difference between method overloading and method overriding ? Illustrate with an example.
b) Write a Java class ComLineTest to print the number of arguments passed on the command line as well as the 1st letter of the arguments. For example, if the command line arguments are “Simple Object Robust” the output will be No. of arguments-3 SOR Write a main method to test the class.
c) How do we define try and catch block ? 4 + 8 + 3
10. a) What is exception ? How can you handle the exception in Java ? Explain.
b) What is user-defined exception ? Explain with a suitable program.
c) What is the use of “finally” keyword ? ( 1 + 5 ) + ( 2 + 5 ) + 2
11. Write short notes on any threeof the following : 3 x 5
b) Exception handler
d) Container class