AP Computer Science A Ultimate Guide

studied byStudied by 2956 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.

Studying Progress

0%
New cards
60
Still learning
0
Almost done
0
Mastered
0
60 Terms
1
New cards

Symbol(s) used to add a comment

//
New cards
2
New cards

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
New cards

Logical error

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

New cards
4
New cards

Run-time error

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

New cards
5
New cards

Print statement

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

Code to assign value to identifier

type identifier = value;
New cards
7
New cards

Primitive data

Basic types of data

New cards
8
New cards

Integer (int)

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

New cards
9
New cards

Double

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

New cards
10
New cards

Boolean

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

New cards
11
New cards

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
New cards

Modulus operator

% - Returns the remainder once two numbers are divided.

New cards
13
New cards

Casting

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

New cards
14
New cards

Casting double to an int

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

Casting int to a double

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

Increment operator

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

New cards
17
New cards

Decrement operator

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

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

Object

A data type created in Java.

New cards
21
New cards

String

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

New cards
22
New cards

Immutable class

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

New cards
23
New cards

Object

data type created in Java

New cards
24
New cards

Class

used to build objects

New cards
25
New cards

“if” statement

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

New cards
26
New cards

Boolean Operator

==

New cards
27
New cards

Logical And

&&

New cards
28
New cards

Logical Or

||

New cards
29
New cards

Not Equal To

!=

New cards
30
New cards

DeMorgan’s Law

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

New cards
31
New cards

while loop

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

New cards
32
New cards

infinite loop

loop that repeats forever because of condition

New cards
33
New cards

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
New cards

class

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

New cards
35
New cards

method

group of code that performs specific task

New cards
36
New cards

object class

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

New cards
37
New cards

header

defines method function

New cards
38
New cards

constructor

sets object’s initial values for instance variables

New cards
39
New cards

instance variables

attributes in a class, also known as fields

New cards
40
New cards

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
New cards

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
New cards

aggregate class

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

New cards
43
New cards

static variable

attribute that is shared among all instances of a class

New cards
44
New cards

arrays

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

New cards
45
New cards

sequential searches

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

New cards
46
New cards

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
New cards

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
New cards

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
New cards

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
New cards

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
New cards

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
New cards

dynamically sized

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

New cards
53
New cards

2D array

array within an array, like a vending machine

New cards
54
New cards

inheritance

A way to create a relationship amongst classes.

New cards
55
New cards

inheritance hierarchy

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

New cards
56
New cards

multiple inheritance

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

New cards
57
New cards

overridden

new version of code takes over old version

New cards
58
New cards

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
New cards

recursive call

characteristic to call a method itself

New cards
60
New cards

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 25 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 15 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 38 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 17116 people
Updated ... ago
4.8 Stars(88)
note Note
studied byStudied by 35 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 5 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 17 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 1335 people
Updated ... ago
5.0 Stars(13)

Explore top flashcards

flashcards Flashcard39 terms
studied byStudied by 7 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard56 terms
studied byStudied by 8 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard58 terms
studied byStudied by 6 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard86 terms
studied byStudied by 1 person
Updated ... ago
5.0 Stars(1)
flashcards Flashcard43 terms
studied byStudied by 6 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard31 terms
studied byStudied by 10 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard154 terms
studied byStudied by 18 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard59 terms
studied byStudied by 1591 people
Updated ... ago
4.0 Stars(25)