Title: Inheritance (extend): Exam
questions tests - Sun
Certified
Java Programmer 310-065 - Lesson 60
Duration: 16 minutes.
Summary: In this video, we are continuing the first set of the exam questions. We start with a question that covers class inheritance (extend). One important point to remember is that you can have a parent class pointing to a child (an Employee referencing an HourlyEmployee). But, for the other way around, you need to cast to the appropriate class. On the second question, we discuss the fact that only instance methods can be overridden, and calls to ‘super’ only apply to overridden methods. On the third question, we talk about is-a and has-a relationship. In has-a, we have a containment relationship (i.e. class A has classB). But for is-a, we are talking about inheritance (a Rectangle is-a Shape). Finally, we cover HashMaps. The trick to these questions is making sure you are using the correct method. In this case, the method ‘add’ was used instead of ‘put” which causes a compilation failure.
Methodology of the development of example: Good coding standard and simplified design to prepare for the Java programmer certification exam CX-310-065.
Technology Used: Java – Core Concepts.
Keywords: Class, object, static, extend, super, is-a, has-a, Map, HashMap.












Post stats:
See the prices for this post in Mr.Bool Credits System below: