Skip to content

Videos

Java for AP CS A

Pick a topic to watch.

19 video lessons

1:47 Lesson 1 Java basics AP Computer Science A uses Java, and Java looks intimidating on day one because of the ceremony around your code. So look at what is actually there. In the… 2:21 Lesson 2 Using objects Here is the picture the whole lesson depends on. When you write String greeting equals Hello, the variable does not contain the letters. It holds a reference… 1:55 Lesson 3 Booleans and selection A relational operator compares two values and produces a boolean — true or false. Score greater than fifty is true. Score double-equals one hundred is false.… 1:52 Lesson 4 Loops in Java Every loop, in every language, needs the same three parts, and a while loop spreads them out where you can see them. A start: i is set to one, before the loop.… 1:44 Lesson 5 Strings and nested loops To go through a String you loop over its indexes and read one character at a time with charAt. Watch the index move along. Now look at the test carefully: i… 2:02 Lesson 6 Writing a class Until now you have used other people's types. Now you make your own. A class is a blueprint: it says what a Dog HAS — a name and an age. Those are its instance… 1:54 Lesson 7 Encapsulation Encapsulation means hiding an object's data and only changing it through methods. Mark a field private and outside code cannot touch it — the direct route is… 1:43 Lesson 8 Arrays An array holds many values of one type under one name. Each value sits at an index, and indexes start at zero. So with three scores, scores zero is ninety and… 2:09 Lesson 9 Array algorithms Four array jobs turn up on nearly every paper, and they are all the same shape. Sum: start at zero and add every value. Count: start at zero and add one, but… 2:03 Lesson 10 ArrayList An array's length is frozen the moment you make it, and often you do not know how many things there will be. That is what ArrayList is for. Watch: names dot… 1:54 Lesson 11 The remove bug The safe way to keep only some items is not to remove the others — it is to build a second list. Walk the original, test each value, and the loop copies the… 1:41 Lesson 12 2-D arrays A 2-D array is a grid — really, an array whose items are themselves arrays, one per row. To reach a cell you give two indexes, and the order is fixed: row… 1:41 Lesson 13 Searching Linear search checks the items one after another from the start. Watch the counter climb: one look, two, three, and it keeps going until it lands on… 1:56 Lesson 14 Sorting Selection sort works by finding the smallest value in the unsorted part and swapping it to the front. Start with seven, three, nine, two, five. Smallest is… 2:02 Lesson 15 Recursion A recursive method is one that calls itself, and every single one has exactly two parts. The base case is the question it can answer directly, with no further… 1:38 Lesson 16 Text files PrintWriter writes to a file with the same println you already know. But there is one line people forget, and it costs everything. Leave out close and nothing… 1:59 Lesson 17 Inheritance Inheritance lets one class build on another instead of copying it. Animal has a name and a speak method; Dog and Cat extend Animal, so they get both for free… 1:44 Lesson 18 Polymorphism Here is the idea, and it is worth watching rather than reading. The variable is declared as an Animal, and it points at a Dog. Call a dot speak and you get… 1:47 Lesson 19 The four FRQ types The free-response section is four questions, and every year they are the same four shapes. Question one asks you to write a method from a description — that is…

Log in or create account

IGCSE, A-Level & AP