Describe the concept of inheritance and explain how the inhe
Describe the concept of inheritance, and explain how the inheritance tree is traversed to bind method calls with method implementations in an object oriented system. Given the definitions of the Date and IncDate classes in this chapter, and the following declarations int temp Date date1 = new Date (10.2.1989) Date date2 = new Date (4.2.1992) Inc Date date3 = new Inc Date (12.25.2001) indicate which of the following statements are illegal, and which are legal. Explain your answers. temp date1 .getDay() temp date 3. getYear() date1 increment (). date 3. increment () date1.incremenet() date3.increment() date2 = date1 date2 = date3 date3 = date2 create a Date class and an Inc Date class as described in this chapter (or copy them from the website). In the IncDate class you must create the code for the increment method, as that was left undefined in the chapter. Remember to follow the rules of the Gregorian calendar: A year is a leap year if either (1) it is divisible by 4 but not by 100, or (2) it is divisible by 400. Create an application that uses these classes. Modify your Inc Date class from Exercise 29 so that it also provides the increment method that accepts an argument numDays of type int and modifies date so that it is numDays later. For example, if the date represents December 31 2002, then after an invocation of increment (3) the date would represent January 3, 2003. You will extend Bowling Game class from Exercise 25 with a new class your called RBowlingGame (\"Robust Bowling Game\").
Solution
Answer
27.
Inheritance is a property of object oriented programming langauge by which a class can use the properties and methods of another class.The class that uses the properties and methods of another class is called the derived class and the class of which properties and methods are being used is called the super class.
The inheritance tree is traversed in a hierarichcal manner to bind method calls with methods implementations in an object oriented system.
28.
b is illegal as get.Year() has been depricated since 2000 and won\'t give what is needed.
g is illegal as data type does not matches
rest of them are legal.
