0% found this document useful (0 votes)
8 views3 pages

Java PYQ

Uploaded by

rs3933434
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

Java PYQ

Uploaded by

rs3933434
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

2023

1. Question are:

(a) Differentiate between print() and println() methods in Java.

(b) What are symbolic constants? Explain with examples.

(c) What is the difference between error and an exception?

(d) Explain JVM.

(e) What are the benefits of Object-oriented programming languages?

(f) Explain the 'this' keyword.

(g) What do you mean by polymorphism?

(h) What is a Thread?

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.

3. Explain the following:

(i) Class and Object

(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

8. Write a program in Java to create Threads. (16 marks)

9. Explain stream and stream classes of Java. (16 marks)


2024

Section A

1. Answer the following questions briefly: 2 each

(i) How does Object-Oriented Programming impact real-world applications? Provide examples.

(ii) Explain encapsulation, inheritance and polymorphism briefly.

(iii) Discuss the importance of access control modifiers in Java.

(iv) Explain the use of the 'this' keyword in Java.

(v) Briefly explain Java's exception handling mechanism.

(vi) What is the purpose of the 'finally' clause in Java exception handling?

(vii) Why is synchronization important in Java multithreading?

(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)

You might also like