0% found this document useful (0 votes)
18 views

OOPs Through Java Assignments (3,4,5)

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

OOPs Through Java Assignments (3,4,5)

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

SUB : OBJECT ORIENTED PROGRAMMING THROUGH JAVA

Last date for submission : 20/11/2024.

Assignment III

Arrays and Inheritance

2-Mark Questions:

1. Define an array in Java. How do you declare and initialize an array?

2. What is the difference between static and dynamic arrays?

3. Explain the concept of two-dimensional arrays with an example.

4. What is the role of the Object class in inheritance?

5. What does the final keyword do in the context of class inheritance?

5-Mark Questions:

1. Discuss the various operations that can be performed on arrays, including searching and sorting.
Provide examples for each.

2. Explain the different types of inheritance supported in Java (single, multiple, multilevel, hierarchical,
hybrid) with examples.

3. Describe method overriding and provide a code example demonstrating this concept.

4. Define abstract classes and interfaces. How do they differ in their usage, and when would you use
each?

Assignment IV

Packages, Exception Handling, and Java I/O

2-Mark Questions:

1. What is a package in Java? Why is it used?

2. How do you create a package and import it into a Java program?

3. What are wrapper classes in Java?

4. What is the difference between throws and throw?

5. Define the Scanner class and its purpose in Java I/O.

5-Mark Questions:

1. Discuss the significance of the java.lang package and its commonly used classes.

2. Explain the hierarchy of standard exception classes in Java. Provide examples of checked and
unchecked exceptions.
3. Describe the use of try, catch, and finally blocks in exception handling with a code example.

4. Explain the difference between byte streams and character streams in Java, and provide examples of
each.
Assignment V

String Handling, Multithreading, and JDBC

2-Mark Questions:

1. What is the difference between String, StringBuilder, and StringBuffer?

2. What methods are available in the String class for modifying strings?

3. Explain the Thread class and its purpose in Java.

4. What are the different states of a thread?

5. What is JDBC, and why is it important for database connectivity in Java?

5-Mark Questions:

1. Discuss string comparison and manipulation methods in Java. Provide examples of at least three
methods.

2. Explain the concept of multithreading and its importance in modern applications. Provide a real-
world example where multithreading is beneficial.

3. Describe the steps to establish a JDBC connection to a database. Include code snippets to illustrate
the process.

4. Explain inter-thread communication in Java and discuss the methods wait(), notify(),
and notifyAll() with examples.

You might also like