Hacks

  • Watch the college board video Classes and Objects* Blog and Define the details of a Class: Access modifier, constructor, modifiers/setters, getters, etc.
  • Build example code in jupyter notebook with Linked List, Queues, and Stacks.
  • Show familiarity with managing data (aka nodes in LL) in these structures.
  • Show familiarity with Generic data and ForEach loop support, similar to ArrayLists T. Here is sample Java Generic T and the Java Iterable interface by Geeks4Geeks.

Watch the college board video Classes and Objects* Blog and Define the details of a Class: Access modifier, constructor, modifiers/setters, getters, etc.

Define vocabulary

  • constructor:
    creating class object, can have multiple constructor under a class(different argument). Usually when we use method outside the class, we first need to create a class object by calling the constructor, then use object.method().
    For example we can use the static methods from the math class we import in the directory like sqrt(), random()...etc and creating Math object to do the calculation.
    Math.sqrt(argument), Math.random(). - all the methods are return methods.

The collegeboard video didn't talk about Access modifier, modifiers/setters, and getters. So I find the definition online:

1.Access modifier:
Default – No keyword required
Private
Protected
Public

Default: When no access modifier is specified for a class, method, or data member – It is said to be having the default access modifier by default.

Private:

  • The methods or data members declared as private are accessible only within the class in which they are declared.
  • Any other class of the same package will not be able to access these members.
  • Top-level classes or interfaces can not be declared as private because
    • private means “only visible within the enclosing class”.
    • protected means “only visible within the enclosing class and any subclasses”

Protected:
The methods or data members declared as protected are accessible within the same package or subclasses in different packages.

Public:

  • The public access modifier has the widest scope among all other access modifiers.
  • Classes, methods, or data members that are declared as public are accessible from everywhere in the program. There is no restriction on the scope of public data members.


Getters/Setters:

getter - return the value, ex. accessors methods
setter - sets/update the value, ex. mutators methods

Build example code in jupyter notebook with Linked List, Queues, and Stacks.

Show familiarity with managing data (aka nodes in LL) in these structures.

Show familiarity with Generic data and ForEach loop support, similar to ArrayLists T. Here is sample Java Generic T and the Java Iterable interface by Geeks4Geeks.

Hacks:Code

Challenge #1

Add and Delete elements from Queue. Working with the code that is given, you will need to adjust Add and write Delete, to output from the Queue as follows.