Problem 1
What is the difference between composition (has-a) and inheritance (is-a)?
Problem 2
What is the difference between overriding and overloading a method?
Problem 3
Describe the syntax of single inheritance in Java.
Problem 4
What is inheritance and what are its uses?
Problem 6
When do we declare a variable, method, or class final?
Problem 7
When do we declare a method or class abstract?
Problem 9
Create a base class called Shape, it contain two methods getxyvalue() and showxyvalue() for accepting co-ordinates and to displaying the same. Create a subclass called Rectangle. It also contains a method to display the length and breadth of the rectangle called showxyvalue(). Use the overriding concept.
Problem 10
Write a class called TV with the following attribute. Name of the company and Screen size using super keyword and Inheritance to create a color TV class, it has a attribute TVtype also a BW TV class it is also have TVtype attribute in Boolean data type.
Problem 11
Write a program that creates an abstract class called dimension. Create two subclasses, rectangle and triangle, that include appropriate methods for both the subclasses that calculate and display the area of the rectangle and triangle.
Problem 12
Write a program that has an overloaded method. The first method should accept no arguments, the second method will accept one string and the third method should display the message. "Welcome to java" once. The second method should display the message "Welcome to polymorphism" twice and the third method should display the message "Welcome to overloading" three times.