< Revature

Notes Excerpt

../img/bkg/revatureCover.png

The world's leading tech talent enablement company.

OOP SECTION


Pillars of OOP - Inheritance, Polymorphism, Encapsulation, Abstraction

Inheritance - is-a relationship. Can not inherit more than one. Hierarchy structure.

Interfaces can only have method signatures and data members. Interfaces are implemented and the child or inherited class must define constructor and methods.

  Example:
  public class square implements rectangle {}
  or
  public interface square extends rectangle {}


Polymorphism - Overloading methods, declaring multiple method declarations with a variety of input parameters
Polymorphism - Overriding methods, allowing child classes to rewrite method functionality of a parent class

Encapsulation - Data hiding, private methods, private data members, read only (only getter methods) write only classes (only setter methods)
Java Access Modifiers - private (class), default (typically package), protected (by sub class or package), public (any);

Abstraction - a programming technique with the intent of only showing essential functionality or details.

Abstract classes must be extended, can’t be instantiated, and need methods implemented. Abstract classes can have constructors, methods, and data members.

  Example:
  public class child extends parent {}



Objects - entities with States and Behaviors.

Constructors - named after class, cannot be final, abstract, synchronized or, static, constructor does not return a value.

Types of constructors - default, no-argument, parameterized


Java


Example:

public class Test {
  public static void main(String args[]) {
    System.out.print(“Hello World”);
  }
}

Condition Statements:

Enhanced for Loop Example

for(declaration : expression) {
// Statements
}

int [] numbers = {10, 20, 30, 40, 50};

for(int x : numbers ) {
  System.out.print( x );
  System.out.print(",");
}


Exceptions:

java.lang.Object.Throwable.Exceptions

Checked Exceptions are thrown at compile
Unchecked Exceptions occur at runtime or are not checked by the compiler.

Types:
Runtime Exceptions
Other Exceptions

Handle Exceptions with Try, Catch statements. Cause exceptions with the Throw keyword.
Finally Block of Try, Catch Statements always executes regardless of any exceptions.


Keywords:
this - class specific
super - parent reference
Final - can not be overridden or changed.


Data Structures (available in java.util):

Collection
- Queue
- Set (can not have duplicate items)

Array
- Array (only primitive data types)
- ArrayList (can contain objects)

Map
- Map (stores keys to data locations)


Database/SQL


Acronyms:

SQL - Structured Query Language
RDMS - Relational Database Management System

SQL Sub-Languages:
DDL - Data Definition Language - CREATE, ALTER, DROP
DML - Data Manipulation Language - SELECT, INSERT, UPDATE, DELETE
DCL - Data Control Language - GRANT, REVOKE
TCL - Transaction Control Language - SAVEPOINT, ROLLBACK, COMMIT

Vocabulary:
Primary Key - a field or entry on a table that must contain an unique identifying value. Primary Key can not be null.

Foreign Key - the linking entry on a table to an external database or table.
Foreign Keys enable databases to link one table inside another table if the stored values match the internal field’s primary key type.

Example Queries:

SELECT column1, column2, columnN FROM table_name;
SELECT * FROM table_name;

WHERE:
SELECT column1, column2, columnN
FROM table_name
WHERE [condition]
SELECT CUSTOMERS.AGE from CUSTOMERS where AGE > 20; // DB name is prefix before column

INSERT:
INSERT INTO TABLE_NAME (column1, column2, column3,...columnN)
VALUES (value1, value2, value3,...valueN);
INSERT INTO CUSTOMERS (ID,NAME,AGE,ADDRESS,SALARY)
VALUES (1, 'Ramesh', 32, 'Ahmedabad', 2000.00 );

JOIN:
SELECT ID, NAME, AGE, AMOUNT
  FROM CUSTOMERS INNER JOIN ORDERS
  ON CUSTOMERS.ID = ORDERS.CUSTOMER_ID


Software Development Life Cycle (SDLC)

The Phases of SDLC -
Investigation >> System Analysis >> Design >>
Testing >> Operations & Maintenance