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.