terms Flashcards

(65 cards)

1
Q

method overloading

A

multiple methods w/ same name different params

params can differ in quantity or data types

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

instantiate

A

create

eg create a objt by using ‘new’ keywords

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

initialize

A

to set up
assign an initial value

eg to initialize means to provide an initial value b4 it’s used.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

immutable

A

cant be changed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

declare

A

state type of var + name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

assignment

A

throwing away old value and replacing with new one.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

data types

A

describes the type of data such as int, str

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

scope

A

where something is accessible.

eg in java vars only accessible inside region they were created

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is an interface
why/purpose
how - created, connected
other

A

image = animal pet
dog class.

= like class, but a collection of abstract methods.

Purpose

  • Since Java doesn’t support multiple inheritance for classes, interfaces allows a work around by allowing a class to rcv the behaviors of a class and the behaviors from the interface.

How

- interface is declared the same way a class is except the "interface" keyword is used instead of 'class.' eg 
public interface Name {

-interface is implemented by using the “implements” keyword the same way “extends” keyword is used for classes. eg

public class Name implements Nameofinterface

-an interface can extend to another interface by using the “extends” keyword. the child will then inherit parent’s methods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is abstraction
why/purpose
how - created, connected
other

A

image = atm

anything with abstraction think of hiding

= allowing the user to focus only on the functional deliverables of a service while hiding the internal implementation(process).

  • security
  • enhancements w/o impacting the user as user only sees buttons
  • maintainabilty and modularity

-real world eg atm

by using GUI screen we can implement abstraction.

-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what is a data structure

A

= org of data in such a way so that it can be used efficiently.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

algo

A

= recipe. step by step procedure for solving a problem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

polymorphism

A

= many forms. the ability for an object to take on many forms.

it occurs when classes inherit the attributes and methods of another. poly allows us to use those methods to perform diff tasks. this allows us to perform a single action in diff ways.

There are 2 ways to implement polym. oload and oriding. o loading is when there’s a single method name, but diff params. these params can be different either in quantity or data type.

oriding = same method being implemented differently.

what
= many forms. e.g. 1 method multiple implementations.

how
There are 2 ways to implement poly: overloading and overriding.

And there are 2 ways to overload a method: a. same method name with diff number of parameters. b. same as a, but with different data types.

eg a class can have same method name, but different params.

method overriding = same name different implementation. eg if a child class has the same method as the parent class, but a different implementation.

if time

static poly > olading
dynamic poly > orriding, must be inheritance, is-a relationship.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

abstraction

A

what

= useful - details

showing only what’s relevant and useful for the person using it while hiding the implementation process.

eg. atm, elevator

There are 2 ways to implement abstraction:

a. abstract classes (provides partial abstraction)
b. interfaces (100% abstraction)

a. abstract classes are classes that are declared abstract. They are parent classes that cant be instantiated. you would need to instantiate one of its child classes if you want to create a new objt. They may contain both abstract and non abstract methods. b. interfaces are similar to classes but consist of abstract methods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Encapsulation

A

= binding data + behavior into a single unit. an example of this is the java class.

The purpose is to enhance data security. That’s achieved through the use of access modifiers and internal related methods such as getters and setters which provide indirect access to the fields.

how

It protects the data by making fields private and allowing access to them only through their related methods such as getters and setters.

1. via access modifiers.  are keywords that facilitate the encapsulation of components by setting the accessibility of classes and methods. There are 4 types. private, public, protected, default. 
private- accessible only w/in declared class
public - accessible by any other class
protected - same package and subclass
default - specifies default block of code in a switch statement. 
  1. getters returns the value of the attribute.
    naming - start with the word “get” followed by var name eg getName

setters takes a parameter and assigns it to the attribute.
naming - start with the word “set” followed by var name eg setName

how they work together
eg

  1. getter and setter is defined in the class
public class Vehicle {
  private String color;
  // Getter
  public String getColor() {
    return color;
  }
  // Setter
  public void setColor(String c) {
    this.color = c;
  }
}
  1. once they have been defined we can use it in our main
public static void main(String[] args) {
  Vehicle v1 = new Vehicle();
  v1.setColor("Red");
  System.out.println(v1.getColor());
}

// Outputs “Red”

Data protection

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Inheritance

A

= a child class acquires (inherits) the attributes and behaviors from the parent class.

why

REUSEABILITY AND METHOD OVERRIDING

how

by using the “extends” keyword you inherit and can reuse the methods and vars.

eg

class Subclass-name extends Superclass-name

There are 3 types of class inheritance:

single, multilevel and hierarchical.

multiple and hybrid are supported via interface only.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Instantiate an object from a class

A
class Book {
    String title;
    String author;
    int numberOfPages;
    String publisher;
}

Book myBook = new Book (“Coding is art”, “Becky James”, 425);

book = var type (class name)
myBook = var/objt name
new = keyword to create object
Book() =  constructor with fields/ args?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

fields

A

= attributes,

fields

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

dot notation

A

to access fields. to accss a method or var that lives in an objt.

write the name of an object followed by an attribute name of interest, separated by a dot: instanceVariableName.attributeName

eg

myBook.title = "Coding is Art";
myBook.author = "Becky James";
myBook.numberOfPages = myBook.numberOfPages + 10;

dot(.) = within

dodge.getGas()

accessing the getGas() method w/in the class / object dodge.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

abstract method

A

a method with only declaration not implementation. ends with semicolon not curly braces

purpose

An abstract method is how you say, “Here’s something that all the things that extend this class have to do, but they each get to specify how exactly they will do it.”

can only be used in abstract class

declare: abstract type name ();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

constructor

A

similar to a method. job is to initialize objt’s vars.

eg

Student s1 = new Student(“Durga”);

we’re creating an instance of the class student called s1. therefore, we inherit the var called name which is currently null. then we are passing in the name Durga to the student constructor and thus name now = Durga.

and creating a var / objct called s1. then the name Durga will be passed into the student constructor and the result will be stored in the var.

  1. new
  2. s1 objt created
  3. go to Student Constructor
  4. Input Durga (for name) and 101 for row number

rules
-name must be same as class

2 types:
-default(no args) and paramaterized (has specific number of parameters)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

oop

A

= is a programming methodology for designing a program centered around the concepts of classes, objects, PAIE.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

class

A

= a class is blueprint or template from which objects are created. It defines objt data type and methods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

object

A

= instance of a class. has state and behavior.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
conditional statements
checks if a condition is true. if so, then a block of code will be executed. statements: 1. if 2. if else 3. if, else if - if() do x, else if() do y, else if() do z, else 4. nested if if() if() print x and y 5. switch statement tests for equality. if the initial expression equals a case expression then that block of code will be executed + all cases below it. if the test expression does not equal any of the cases then the default case will be executed.
26
looping
executes a code block as long as condition is true. types of loops while do-while for while - checks a condition and then executes a block of code. do-while executes a block of code and then checks a condition. for - for( var; condition; counter) for (i = 1; i<=5; i++) while while(Boolean_expression) { // Statements } do-while do { // Statements }while(Boolean_expression);
27
keywords
nftss ``` new final this super static ``` ``` new - creates an objt. ie an instance of a class. final - stops var value change, method overriding, inheritance. this - refers to current objt. current class instance var, invoke current class method, or constructor super - refers to immediate parent class of an objt. invoke parent class method super.eat(), invoke parent class constructor super(); static - methods/attributes can be accessed without creating an object of a class ```
28
Strings: create a string get length of the string concatenating strings
create (String) (name) = "hello world" String greeting = "hello world"; name. length() string1. concat(string2) "Hello," + " world" + "!"
29
packages
group of related classes (files) we can use in our program packages are either built in or user defined built in is from java api. you access by using the "import" keyword. importing a single class: import package.name.Class eg import java.util.Scanner importing a whole package: import java.util.*;
30
exceptions checked exceptions unchecked errors
event that disrupts normal flow of program. enforced check and therefore must catch or handle them explicity does not enforce check not exceptions. problems that arise beyond cntrl of user or programmer.
31
exception hierarchy
``` java.lang objt throwable -errors -exceptions ----runtime ---- other exceptions ```
32
throw keyword throws keyword finally block
- used to explicitly throw any exception - used to postpone handling of a checked exception. - appears at end of catch blocks. always executes no matter what. allows clean up type statement.
33
array | 2 types
objt contains els of similar data type | single and multidimensional
34
queue
used to hold els about to be processed. uses fifo. eg people queing to pay at super market
35
collection interface
collection = objt that represents a group of objts. foundation upon which the collections framework is built. It declares the core methods that all collections will have
36
list interface
a child interface of collection. declares behavior of a collection that stores a seq of els.
37
array list
a resizable array. when lots of manipulation is needed. provides methods for manipulation.
38
set interface
a collection that cant contain duplicate els.
39
map interface
maps unique keys to values.
40
what is java
a high-level, class-based, object-oriented programming language
41
primary key | foreign key
- a field that uniquely identifies every record in a table. eg social sec num. - links 2 tables together. it matches the primary key from the other table.
42
SQL
-structured query language. programming lang used to communicate with data stored in a RDBS
43
insert query
adds new rows of data to table. eg Insert INTO TABLE_NAME(col1, col2...) values (value1, value2)
44
sql joins
combines records from 2 or more tables. eg SELECT ID, NAME, AGE, AMOUNT FROM CUSTOMERS INNER JOIN ORDERS ON CUSTOMERS.ID = ORDERS.CUSTOMER_ID;
45
select query
used to fetch data from a table eg SELECT column1, column2, columnN FROM table_name; If you want to fetch all the fields available in the field, then you can use the following syntax. SELECT * FROM table_name;
46
sql where
where a particular field meets a particular condition. looking at a particular field and applying a condition to it. eg student.TotalMark > 90
47
sql statements
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
48
relational db system
a program that allows you to create, update and admin a rdb
49
relational db
made up of tables that store interrelated data.
50
dbase
collection of organized data to be accessed, managed, updated.
51
html
Hyper Text Markup Language - describes structure - els = building blks - els represented by tags - tags <><>tags label pieces of content such as "heading", "paragraph", "table", etc.
52
html document
Page Title

My First Heading

My first paragraph.

The declaration defines this document to be HTML5 The element is the root element of an HTML page The element contains meta information about the document The element specifies a title for the document The element contains the visible page content The

element defines a large heading The

element defines a paragraph

54
html images
In HTML, images are defined with the tag. The tag is empty, it contains attributes only, and does not have a closing tag. The src attribute specifies the URL (web address) of the image:
55
html list
2 types Ordered List Unordered List
  1. Coffee
  2. Tea
  3. Milk
56
css
Cascading Style Sheets describes how HTML elements are to be displayed body { background-color: lightblue; }
57
styling html w/ css
3 ways Inline - by using the style attribute in HTML elements Internal - by using a element in the section External - by using an external CSS file inline

This is a Blue Heading

internal
58
css selectors
used to select the element(s) you want to style. .class eg . intro selects all els w/ class = "intro" #id eg #firstname " '' '' '' id = "firstname" * selects all els p selects all

els div, p selects all div els and p els div p selects all p els inside div els div > p selects all p els where parent is a div el div + p selects all p els placed immediately after div els

59
sdlc
``` investigation sys analysis design testing maint and ops ``` inv - bus ops and probs identified and solutions discussed sys ana - determine where prob is in attempt to fix system. breaking down the system into diff pieces. design - describe the new sys as a collection of mods or subsystems. describe fxs, bus rules, process diagrams, screen layouts. testing- code is tested at various levels. unit, system and user acceptance. maint and ops - as new changes happen in org maint and ongoing ops will be req.
60
java
high-level, class-based, object-oriented programming language
61
which languages are good for oop
java, python, c++, c
62
self
``` smile hi ty for the opportuinty to participate in this eval name ed exp - 3 parts why here - rev ------great learning opp ```
63
how to give access to view a table + not allow to modify
grant command
64
how to add elements in table
insert into table_name() values()
65
2 types of polymorp
compile time and runtime