Midterm Vocab 1 - yajatyadav/intellijs GitHub Wiki

Inheritance, Static variables

Static methods

Override, Polymorphism: toString() method from Generics

Creating a Class

Compound Boolean Expression, De Morgan's Law

Constructor, this keyword

Main method, tester methods

For loop, enhanced for loop, nested loops

Comparing Strings

Wrapper Class

Concatenation

Truth Table

Accessor Method, Mutator Method

Object superclass methods

Comparing Objects

Big O Notation (Hash map, Binary Search, Single loop, Nested Loop)

  • Loop : O(n) - time dependent on number of iterations (times a constant)
  • Nested loop: O(n2) - time dependent on number of iterations ^ 2 (times a constant)
  • Hash map: O(1)- the hash function is constant, so finding the location of where a certain item and looking up the value is will be O(1)
  • Binary search: O(log n) - As the number of items in an array doubles, one extra split is added. Since scaling by powers of 2 (exponential) causes a linear increase, the complexity is log n

Comparing Numbers

While vs Do-While Loops

Random (and Math)

Casting for Division

Casting for Truncation and Rounding

Overloading a Method

Abstract Class, Abstract Method

Subclass Constructor, super Keyword

  • Super keyword is used to refer to parent classes’ variables of the same name
  • Super can also be used to call parent class methods with the same name
  • Super also used to call parent class constructor (can chose which constructor if multiple available)
  • Compiler implicitly adds a no-argument super constructor in a child class’s constructor
    • Can be manually changed, ex: super(15), super(“hi”)

Late binding of object

  • Can do so as long as the new class “is a” declared type , ex: Chicken is a Animal (Animal is the superclass)
  • During compile-time, methods in the declared type are checked
  • At run-time, method in the actual object is executed

Web API, REST, Fetch, Async, Request, Response

CRUD