END TERM EXAMINATION -SRM University | |
Fourth Semester[BTech] | June 2024 |
Paper Code: 21CS2010 | Subject : Java Programming |
Time:3 Hour | Maximum Marks:100 |
Instructions:
| |
PART – A (2*10=20 Marks) | |
1. Difference between JVM, JRE and JDK. | |
2. Define Tokens. | |
3. Why do we need inheritance in Java. | |
4. Describe public static void main(String args[]) in Java. | |
5. What are the benefits of Multithreading? | |
6. What is the difference between exception and error in Java? | |
7. How applets differ from application? | |
8. What is JDBC? | |
9. Define Wrapper class. | |
10. Mention the enumeration predefine methods. | |
PART-B (16*5=80) | |
11. a) Briefly explain the java architecture with necessary diagram. (16 Marks) | |
Or | |
b) i) List and describe the features of Java Programing Language. (10 Marks) | |
ii) Explain the Control Flow. (6 Marks) | |
Or | |
Q12. a) Write a Java Program to create a class called Employee with private instance variables employee_id, employee_name, and employee_salary. Provide public getter and setter methods to access and modify the id and name variables, but provide a getter method for the salary variable that returns a formatted strings. (16 Marks) | |
Or | |
b) Write a Java Program to create a vehicle class hierarchy. The base class should be Vehicle with subclass Truck, Car and Motorcycle. Each subclass should have properties such as make, model, year and fuel type. Implement methods for calculating fuel efficiency, distance traveled, and maximum speed (16 Marks) | |
Q13 (a) Explain lifecycle and states of thread in java with neat block diagram? (16 Marks) | |
Or | |
(b) Describe Exception hierarchy. Explain the types of exceptions with appropriate example. (16 Marks) | |
Q14. a) Write a java program to stimulate the layout and working of a simple calculator. (16 Marks) | |
Or | |
Write a short note on : i) JDBC Drivers (4 Marks) ii) JDBC Connections (6 Marks) iii) JDBC ResultSets(6 Marks) | |
UNIT-III | |
Q6. a) Explain the generic class hierarchies with a suitable example. (16 Marks) | |
Or | |
Write short notes on : i) Collections (8 Marks) ii) Lambda Expression (8 Marks) |