END TERM EXAMINATION | |
Second Semester[BCA] | May-June, 2025 |
Paper Code: BCA-104T | Subject : Java Programming |
Time:3 Hours | Maximum Marks:60 |
Note: Attempt five questions in all including Q.No.1 which is compulsory. Select one question from each unit. | |
Q1 Answer the following in brief. (Any four) (4×5=20) | |
(a) What is this keyword? How is it different from super keyword? |
|
(b) Difference between super class and sub class. | |
(c) What do you understand by garbage collection in Java? | |
(d) Discuss the uses of throw and throws keywords. |
|
(e) What is an interface? How is it different from an abstract class? | |
(f) What is exception handling? Mention any two exception types. | |
(g) Explain the four main principles of Object-Oriented Programming with examples in Java. | |
(h) Describe the difference between compile-time and run-time polymorphism with suitable examples. | |
UNIT I | |
Q2. What is a package in Java? How do you create and use a user-defined package? (10) | |
OR | |
Q3. Discuss exception handling in Java with the use of try , catch , and finally blocks. (10) |
|
UNIT-II | |
Q4. Differentiate between String and StringBuffer classes with examples. (10) |
|
OR | |
Q5.Write a Java program to demonstrate the use of interfaces. (10) | |
UNIT-III | |
Q6.Describe the difference between compile-time and run-time polymorphism with suitable examples. (10) | |
OR | |
Q7. Write a Java application using file handling that reads from a text file and writes the content to another file with all text in uppercase. Include exception handling. (10) | |
UNIT-IV | |
Q.8 Explain the concept of multithreading in Java. Write a Java program that creates two threads: one for printing even numbers and another for odd numbers from 1 to 20. (10) | |
OR | |
Q9 Design a Java class BankAccount with fields for account number, account holder name, and balance. Include methods for deposit, withdraw, and display. Write a test class to demonstrate all functionalities. (10) |