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

Assignment Module 2

The document outlines an assignment for a Java module, covering various topics such as access specifiers, class creation, constructors, keywords, abstract classes, inheritance, exception handling, and multithreading. It includes specific tasks like creating a Triangle class, explaining the main method, and discussing the advantages of exception handling. Additionally, it requires examples for concepts like multithreading and the life cycle of a thread.

Uploaded by

vardaanfreesream
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)
4 views1 page

Assignment Module 2

The document outlines an assignment for a Java module, covering various topics such as access specifiers, class creation, constructors, keywords, abstract classes, inheritance, exception handling, and multithreading. It includes specific tasks like creating a Triangle class, explaining the main method, and discussing the advantages of exception handling. Additionally, it requires examples for concepts like multithreading and the life cycle of a thread.

Uploaded by

vardaanfreesream
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

Assignment-Module-2

1. What are the various access specifiers for Java classes? Explain in brief.

2. Create a class Triangle in which initialize the instance variables and define
two methods for calculating area and perimeter of triangle. Create another
class to define main method and use them.

3. Should a main() method be compulsorily declared in all java classes?


4. What is constructors? Explain different types of constructor with an
example.
5. What is the use of static and this keyword? Explain with an example.

6. Discuss the properties of abstract class. What is the difference between


abstract class and interface in java? Explain with an example.

7. What is inheritance? Explain different types of inheritance in detail with


example.

8. What is exception and exception handling? Explain different types of


exception with an example.

9. What is the advantage of exception handling? Explain try and catch block
with an example.

10. What is multithreading? Explain the life cycle of thread in details.

[Link] is the application of multithreading? Write down the example of


thread by extending Thread class and by implementing Runnable interface.

You might also like