AP Computer Science A Ultimate Guide

studied byStudied by 3008 people
4.5(14)
get a hint
hint

Symbol(s) used to add a comment

1 / 59

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

60 Terms

1

Symbol(s) used to add a comment

//
New cards
2

Identifiers

Names that are given to show data that are stored in the memory of a computer when a program is being executed in a computer

New cards
3

Logical error

An error because of the incorrect way a code is structured.

New cards
4

Run-time error

A compiler doesn’t catch this error. It just causes an error with the execution of the program.

New cards
5

Print statement

System.out.print(""); 
New cards
6

Code to assign value to identifier

type identifier = value;
New cards
7

Primitive data

Basic types of data

New cards
8

Integer (int)

It represents any number that is an integer. All positive, negative numbers and zero. Cannot store decimals.

New cards
9

Double

A number that can be positive, negative, or zero, and it can be a fraction or decimal.

New cards
10

Boolean

A value that is either true or false. True = 1, False = 0 in machine code.

New cards
11

Character (char)

It represents a single character that can be represented on a computer. It includes any character that you type on the keyboard. Stored with the use of single quotation marks or an apostrophe.

New cards
12

Modulus operator

% - Returns the remainder once two numbers are divided.

New cards
13

Casting

A process in which data is forced to look like another type of data to the compiler.

New cards
14

Casting double to an int

int x;
double y = 4.5;
x = (int) y;
New cards
15

Casting int to a double

int x = 4;
double y;
y = (double) x;
New cards
16

Increment operator

(++) This increases the value of a number by one.

New cards
17

Decrement operator

(--) This decreases the value of a number by one.

New cards
18
a += b
a = a + b
New cards
19
a -= b
a = a - b
New cards
20

Object

A data type created in Java.

New cards
21

String

An object data type which has a class with many methods that describe the behavior of an object.

New cards
22

Immutable class

Once an object is created, the assigned value cannot change.

New cards
23

Object

data type created in Java

New cards
24

Class

used to build objects

New cards
25

“if” statement

conditional statement that is used in Java to help control the flow of the program

New cards
26

Boolean Operator

==

New cards
27

Logical And

&&

New cards
28

Logical Or

||

New cards
29

Not Equal To

!=

New cards
30

DeMorgan’s Law

to simplify common compound conditions, distribute the ! into the parenthesis and change the && to ||, or vice versa

New cards
31

while loop

loop cycles through again and again, while the condition is considered true

New cards
32

infinite loop

loop that repeats forever because of condition

New cards
33

for loop

statement 1 is executed (one time) before the execution of the code block.

statement 2 defines the condition for executing the code block.

statement 3 is executed (every time) after the code block has been executed.

New cards
34

class

when a group of statements, such as control structures, are all put together to be referred to this

New cards
35

method

group of code that performs specific task

New cards
36

object class

This class houses the “guts” of the methods that the driver class calls.

New cards
37

header

defines method function

New cards
38

constructor

sets object’s initial values for instance variables

New cards
39

instance variables

attributes in a class, also known as fields

New cards
40

precondition

a comment that is intended to inform the user more about the condition of the method and guarantees it to be true.

New cards
41

postcondition

a condition that must always be true just after the execution of a section of code, or after an operation in a formal specification.

New cards
42

aggregate class

Made up of other data, and instances of other classes.

New cards
43

static variable

attribute that is shared among all instances of a class

New cards
44

arrays

a data structure that makes it easier to handle similar types of data

New cards
45

sequential searches

These search through the data one by one in order, and take a long time to execute

New cards
46

binary searches

These search through the data for the desirable value by dividing it into half each time until the desired value is found

New cards
47

sorting algorithms

They take data in an array, and rearrange it into a particular order. They are very powerful because they can accomplish tasks faster, and can make your programs even more efficient.

New cards
48

selection sort

This sort searches and swaps. Once it finds the lowest value, it will swap its position in the array with the data at index 0. The first element is now sorted. The process repeated for index 1. The rest of the array will be searched for the lowest value and is swapped with the data that is found at index 1.

New cards
49

insertion sort

It compares the first 2 elements, and depending on the outcome of this it inserts the second value in front of the first value into index 0, which moves the first value to index 1. The first 2 elements are sorted. Then the third element is checked and this process continues until it’s entirely sorted.

New cards
50

merge sort

This type of sort uses recursion. An array is split into 2 pieces. The piece is sorted. The 2 sorted pieces are merged together into one sorted list. Then in order to sort each of the 2 pieces, the same method is used again until it is fully sorted.

New cards
51

array lists

A huge limitation of arrays is that it has a fixed length, and can only store, one specific type of data.

New cards
52

dynamically sized

used to describe an array list which becomes bigger / smaller as elements are added / removed

New cards
53

2D array

array within an array, like a vending machine

New cards
54

inheritance

A way to create a relationship amongst classes.

New cards
55

inheritance hierarchy

A way to determine how information travels amongst the classes. Ex: The subclasses inherit characteristics of the parent class.

New cards
56

multiple inheritance

when a class has more than 1 superclass, it is defined as ______. not allowed in java

New cards
57

overridden

new version of code takes over old version

New cards
58

polymorphism

When many classes are related to each other by inheritance. Inheritance lets us inherit attributes and methods from another class. uses those methods to perform different tasks.

New cards
59

recursive call

characteristic to call a method itself

New cards
60

base case

Signal the execution to stop the recursion and return to each prior recursive call

New cards

Explore top notes

note Note
studied byStudied by 37 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 6 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 6 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 8 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 8 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 9 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 9 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 93 people
Updated ... ago
5.0 Stars(1)

Explore top flashcards

flashcards Flashcard178 terms
studied byStudied by 22 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard35 terms
studied byStudied by 8 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard130 terms
studied byStudied by 33 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard138 terms
studied byStudied by 9 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard208 terms
studied byStudied by 37 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard61 terms
studied byStudied by 4 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard103 terms
studied byStudied by 20 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard358 terms
studied byStudied by 27 people
Updated ... ago
5.0 Stars(1)