AP Notes, Outlines, Study Guides, Vocabulary, Practice Exams and more!

AP Computer Science A Chapter 7-9 Flashcards

Terms : Hide Images
6005276391for loop syntaxall 3 parts at top (initialization; test; update)0
6005276392for loop steps1. Initialization 2. Test 3. Loop Body 4. Update 4. Re-test1
6005276393type of loop for loop usually iscount controlled2
6005276394When you declare a variable in a for loop the variable only exists where?in the for loop and no where else3
6005276395sum = sum + k; →sum+=k;4
6005276396How many returns can you havemultiple5
6005276397What does 1 return have to be if have multipleconditionalized6
6005276398Where return statements usually usedvalue returning methods (can be in void but not often)7
6005276399What happens when you returnleave the method8
6005276400breakgets out of loops (NEVER USE)9
6005276401What kind of structure is an arraydata structure10
6005276402What do arrays docombine bunch of different values into a variable11
6005276403what kind of data type an array iscomposite data type12
6005276404Everything in an array has to have the samedata type13
6005276405elementeach item in array14
6005276406size or length# of items that can fit15
6005276407index/subscriptuse in order to access values16
6005276408Default value upon initialization for booleanfalse17
6005276409Default value upon initialization for int018
6005276410Default value upon initialization for Stringnull ""19
6005276411first position of an array020
6005276412last element in an array#-121
6005276413once set an array it's set for how longforever22
6005276414explicit array creationhave to know data type, order, and # of elements23
6005276415NullPointerException erroraccessing items in an array that don't exist24
6005276416ArrayIndexOutOfBoundsException errorgo off end in array by accessing indices that don't exist25
6005276417Array length vs. string lengthdon't have () for arrays26
6005276418length array method or attribute?attribute27
60052764192D length ROWSc.length;28
60052764202D length COLSc[0].length;29
60052764211D array declarationdata type [] name = new data type [#];30
60052764222D array declarationdata type [] [] name = new data type [#] [#];31
60052764231D making arraydata type name = {#, #, #}32
60052764242D making arraydata type name = { {#, #, #}, {#, #, #} };33
6005276425for each loopuse for traversing arrays (looking at EVERY element) in order (first → last)34
6005276426when don't use for each loopif want to look at index35
6005276427if primitive data type, why can't you change in a for each loopbecause just getting copy of thing you're pulling out36
6005276428what do you get when you pass for primitive in for each loopget a copy37
6005276429what do you get when you pass for reference in for each loopget memory address (where it is_38
6005276430primitive data typechar, int, double, boolean39
6005276431reference data typeString40
6005276432when can you change a variable in a for each loopif give the same memory address41
6005276433add element from an arrayshift a few elements toward end of the array (starting from last element) to create an empty slot in the position you want42
6005276434remove element from an arrayshift all elements that follow it by one toward the beginning of the array43
6005276435if removing element from an array there is no way to remove the last value that you don't want. What do you do?know how many elements are relevant and only focus on those44

Need Help?

We hope your visit has been a productive one. If you're having any problems, or would like to give some feedback, we'd love to hear from you.

For general help, questions, and suggestions, try our dedicated support forums.

If you need to contact the Course-Notes.Org web experience team, please use our contact form.

Need Notes?

While we strive to provide the most comprehensive notes for as many high school textbooks as possible, there are certainly going to be some that we miss. Drop us a note and let us know which textbooks you need. Be sure to include which edition of the textbook you are using! If we see enough demand, we'll do whatever we can to get those notes up on the site for you!