0% found this document useful (0 votes)
4 views1 page

JAVA Assignment I

The document is an assignment for the III Semester AI&DS 2024-2025 at Maharaja Institute of Technology Thandavapura, focusing on Object-Oriented Programming with Java. It includes various questions related to Java concepts such as access control keywords, static members, the final keyword, inner classes, inheritance, abstract classes, packages, interfaces, exception handling, and the finally block. Each question requires explanations and code examples to illustrate the concepts.

Uploaded by

bcgirish18
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
4 views1 page

JAVA Assignment I

The document is an assignment for the III Semester AI&DS 2024-2025 at Maharaja Institute of Technology Thandavapura, focusing on Object-Oriented Programming with Java. It includes various questions related to Java concepts such as access control keywords, static members, the final keyword, inner classes, inheritance, abstract classes, packages, interfaces, exception handling, and the finally block. Each question requires explanations and code examples to illustrate the concepts.

Uploaded by

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

MAHARAJA INSTITUTE OF TECHNOLOGY THANDAVAPURA

DEPARTMENT OF ARTIFICIAL INTELLIGENCE AND DATA SCIENCE

III Sem AI&DS 2024- 2025


OOP with JAVA(BCS306A) – Assignment I
1. Which are the different access control keywords or access specifiers in Java. Explain with an
example.
2. What is a static member of a class. With an example program show how to access static
methods in Java.
3. Which are the different uses of final keyword in Java. Illustrate with an example code.
4. What is an inner class. Illustrate with an example.
5. Write a program to extend Box class by BoxWeight class. And show how base class methods
can be accessed(Inheritance).
6. Explain different uses of super keyword in Java with example.
7. What is an abstract class. WAP to create an abstract class Shape, consisting of an abstract
method area(), and implemented by 3 classes Circle, Triangle and Square and print their
area.
8. What is a package and How to use a package? WAP to create a user defined package MyPack
and imported by another class MyProgram and call Method inside the package.
9. What is an interface in java. How to implement an interface? Explain with code.
10. WAP to illustrate static methods in interface and how to access it.
11. What is a default method in interface. What are its characteristics?
12. What is a private method in an interface. WAP to illustrate how to use a private method in
interface.
13. Explain the different Exception handling keywords in Java, with example code for each.
14. WAP to explicitly throw an exception of type IndexoutofBound Exception to a calling method.
15. What is finally block? Explain when a finally block is executed with an example code.

You might also like