Answered step by step
Verified Expert Solution
Question
1 Approved Answer
**** ONE response commenting on the posts uploaded by your friends. Computer Programming II (CS141) Discussion Board Topic of Discussion: 1. Why do you need
**** ONE response commenting on the posts uploaded by your friends.
Computer Programming II (CS141) Discussion Board Topic of Discussion: 1. Why do you need to implement all the methods of an interface in class which implements an interface? 2. Discuses Why Inheritance is used by Java Programmers? And What Type of Inheritance does Java Support? Submission Instructions Post your answers and discussions on the blackboard. . You are required to write at least ONE original post and ONE response commenting on the posts uploaded by your friends. 1 day ago Discussion 1 1- Interfaces are not for code reusability. Interfaces represent a behavior that an object has and do not care about how it implements this behavior. Once you implement an interface using a class, you must provide body implement) to all of its abstract methods. If you don't a compile time error will be generated for each unimplemented method saying "Interface Example is not abstract and does not override abstract method method_name in interface_name". 2- Inheritance is used for code reuse and leveraging Polymorphism by creating a type hierarchy. It's better to use Inheritance for type declaration but for code reuse composition is a better option because it's more flexible. java supports single Inheritance, multi-level inheritance and at some extent multiple inheritances because Java allows a class to only extend another class, but an interface in Java can extend multiple inheritances. Reply
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started