Java PYQ
Java PYQ
1. Question are:
Unit I
2. What do you mean by the OOP paradigm? What are the main advantages of OOP over traditional programming
languages? Explain in detail.
(ii)Abstraction.
(iii)Inheritance.
(iv)Method Overriding.
Unit II
4. (a) Explain briefly: class, public, static, void, main, string[], and system.out.println keywords. (8 marks)
(b) Write a Java method/program to find the sum of two given values. (8 marks)
5. What is constructor overloading? Write a program demonstrating constructor overloading in Java language.
(16 marks)
Unit III
6. (a) Write the differences between an interface and an abstract class. (8 marks)
(b) Write the procedure to create a package with multiple public classes. (8 marks)
7. What is exception handling? Explain an example of exception handling in the case of division by zero.(16 marks)
Unit IV
Section A
(i) How does Object-Oriented Programming impact real-world applications? Provide examples.
(vi) What is the purpose of the 'finally' clause in Java exception handling?
(viii) What are the 'transient' and 'volatile' modifiers used for in Java?
Section B
Unit I
2. Discuss the fundamental concepts of Object-Oriented Approach, such as encapsulation, inheritance and
polymorphism and their importance in software development. (16 marks)
3. Describe method overriding and polymorphism in Object-Oriented Programming, detailing how they
facilitate dynamic behavior and code reuse. Provide examples to demonstrate their usage in practical
scenarios. (16 marks)
Unit II
4. Discuss the various primitive data types in Java and provide examples of their usage. Explain the difference
between primitive data types and reference types. (16 marks)
5. Explain the concept of method overloading in Java. Provide examples illustrating method overloading with
different parameter lists and return types. Discuss the benefits and limitations of method overloading.
Unit III
6. Explain the concept of a package in Java and how it helps in organizing classes and interfaces. Describe the
accessibility levels of packages in Java, including default, public, protected, and private, and provide
examples of each. (16 marks)
7. What are the different types of exceptions in Java, and how are they categorized? Provide examples for
each type. (16 marks)
Unit IV
8. What is the StringBuffer class in Java, and how does it differ from the String class? Discuss the methods
available in StringBuffer for string manipulation. (16 marks)
9. What is synchronization in Java multithreading, and why is it important? Explain with examples how
synchronization is achieved. (16 marks)