GoConqr has a new look! Let us know what you think.

Mind map

Implementing Classes

John Hair English

Map content

Implementing Classes

  1. Superclass(parent) versus subclass(child)

    • Extending to a class
      • Gives the subclass the ability to use the methods used before, or even add more.
        • Abstract Classes
          • A class that has one or more abstract methods.
        • Interfaces
          • A class made entirely of abstract methods. Must be implemented instead of extended. Famous interface is the Arraylist interface
        • Abstract Methods: Methods with no body; must be given an implementation by the subclass.
      • Implementing Superclass
        • Overriding an inherited method means providing a method in a child class with the same method signature (method name and parameter type list) and return type as a method in the parent class.
        • Overloading a method is when several methods have the same name but the parameter types, order, or number are different. Allows for multiple constructors in the same class.
  2. Variables

    • Instance variables
      • Private variables for only the class. Accessor methods can be written to give the programmer the variable using encapsulation
    • Parameters
      • Variables given to the method.
        • Implicit: The object used to get to the method. For example, student.setAge(15);. The implicit parameter is the student object
        • Explicit: the value(s) the method will be taking in and using to run. For example, student.setAge(15);. "15" would be the explicit parameter.
  3. Encapsulation

    • Hides the instance variables by making them private. Generally, accessor methods will be public to allow the access of these private variables.

Information

Description
Mind Map on Implementing Classes, created by John Hair on 24/04/2018.
Created by
John Hair
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?