Reference no: EM132099995
Please provide explanations for the topics mentioned as well as simple examples for each.
Each explanation should include an example (or examples).
The examples should:
- be easy to understand.
- include all componenets (class/method declaration etc...).
Programming
1. Given partial definitions of a superclass and subclass - including instance variable declarations, method declarations, and Java documentation comments - be able to write the method bodies
2. Explain how superclasses and their extending subclasses are used to implement polymorphism, and the benefits of inheritance
3. Explain encapsulation - the benefits of encapsulation and why breaking encapsulation is considered a violation of the "prime directive" of OOP
4. Compare and contrast abstract superclass, concrete superclass, and interface
5. Compare and contrast:
a. Java's Comparable and Comparator interfaces
b. arrays and linked lists
c. the equals method and the "==" operator
d. instance variables and static "class" variables
6. Understand code that manipulates abstract stacks and queues, using stack methods push, pop, peek, and isEmpty, and queue methods append, serve, and isEmpty
7. Understand and be able to write code that performs simple operations on linked lists of nodes
8. Given the definition of a simple recursive method, show what will be returned for a given call, and be able to write a simple recursive method.