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

AP CS Flashcards

Terms : Hide Images
13963576732importing classesimport java.packagena,e.subpackagename.class;0
13963578338single line comment//1
13963578339multi line comment/** **/2
13963579083Identifiername for a variable, parameter, constant or user defined method/class3
13963581427primitive typesint, double, boolean, char4
13963584918does casting truncate or roundtruncate5
13963584919Largest int2^31-16
13963585458Smallest int-2^317
13963586293n int storage-2^n-1 to 2^n-1 - 18
13963593166floating point numberssign ** mantissa ** radix/base (2) ^ exponent9
13963595915roundoff errorwhenever a normally true expression deals with repeating decimals or irrational numbers; when converting from floating point roundoff is highly likely10
13963601631hexadecimal0-9 is A-F, google the rest11
13963604404Octsame as hex except base 812
13963609264comparing floating point numbers|x-y| <= ℰmax(|x|, |y|)13
13963612277Arithmetic+, -, *, /, %14
13969259719bitwise&, !15
13963614050Logical&&, ||16
13963614496rational==, !=, >, <17
13963615638Assignment-, +=, -=, *=18
13963616458Inc/Dec++/--19
13963617703mega precedence level 1!, ++, --20
13963618103mega precedence level 2*, /, %21
13963618875mega precedence level 3+, -22
13963619377mega precedence level 4<, >, <=, >=23
13963620235mega precedence level 5==, !=24
13969207773mega precedence level 6&25
13969209496mega precedence level 7|26
13963620936mega precedence level 9||27
13963620236mega precedence level 8&&28
13963620937mega precedence level 10=, +=, -=, *=, /=, %=29
13963624599encapsulationKeeping details (like data and procedures) together in one part of a program so that programmers working on other parts of the program don't need to know about them.30
13963625492static methods• method connected to the class, not an object • ex: Math.random • You do not declare a variable of Math type to get to the random method31
13963626294static variables• variable is connected to the whole class, not individual objects • all variables of the class share this one variable • with the keyword final it is used to create a constant • also called: class variables32
13963627571methodspublic/private static/ void/int/string name (parameters)33
13963628802constructorssets default for class34
13963629283accessor (getter)Method that returns the current value of a specified data field.35
13963629284mutatorA method used to change the value of an attribute of an object.36
13963629975method overloadingThe ability to define two or more different methods with the same name but different method signatures.37
13963630823this keywordan implicit parameter that ties an object to the instance called38
13963633073primitve/other parametersprimitive data types do not change when passed into parameters, as the parameters make a copy of the object, although with other objects, the original object is changed from a function39
13963637137is-aA phrase to say that something inherits from another, as in a "salmon" is-a "fish."40
13963637938extendinherits41
13963638663inheritance doesn't takeprivate things or make private things public42
13963641872Rules of a subclass 1A subclass can add new private/instance variables43
13963643554Rules of a subclass 2A subclass can add new public, private or static methods44
13963644437Rules of a subclass 3A subclass can override inherited methods45
13963645040Rules of a subclass 4A subclass may not override static methods46
13963645918Rules of a subclass 5A subclass must define its own methods47
13963647131Rules of a subclass 6Subclass must use getters+setters48
13963648427Polymorphismpolymorphism is the provision of a single interface to entities of different types or the use of a single symbol to represent multiple different types.49
13963653945Dynamic bindingtype of object is not determined until run-time50
13963653946Static Bindingtype of object is determined at compile time51
13963655172Abstract Classa class that defines attributes and methods for subclasses but is never instantiated52
13963655902rules for abstractyou can't instantiate and you must implement all methods53
13963662151interface rules1. Exceptions should be declared by interface method. 2. Signature and return type should be the same for interface and implemented class. 3. A class can implement multiple interfaces. 4. An interface can extend another interface. 5. No instance variables54
13963665336Math.randomGenerates a random floating point number between 0 & 1. double x = (highValue - lowValue) * Math.Random() + lowValue55
13963672232primitive types rulesprimitive types have a default value, but all other objects will not therefore they will result in a nullPointerException56
13963678368Selection Sorttake the entire array and find the lowest value, take that and make it index 0, now take the new array (1-array.length-1) and do the same, add all the arrays at the end for the final sorted product57
13963683802Insertion Sort58
13963687002Quick sorttake a random element and define that as the pivot. Once you have a pivot take a clicker on both opposite ends of the array, once you have done that, move the pointers until the one on the left is pointing to an element less than the pivot and the one on the right is pointing to one greater than the pivot and swap them, move them again until they meet at the middle, at this point all the elements to the left of the pivot are less than the pivot and all the elements right of the pivot are greater. Separate the two arrays into smaller arrays and perform quicksort again.59
13963695423Sequential SOrtessentially insertion sort with moving elements to the max rather than the minimum, sorting algorithm that typically uses nested loops and requires approximately n^2 comparisons to sort n elements60
13963696225Binary SearchBasically it goes to the middle element, is the middle element greater or less than the value, if its more than it will take the middle of the greater half, and repeat the process61

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!