13963576732 | importing classes | import java.packagena,e.subpackagename.class; | 0 | |
13963578338 | single line comment | // | 1 | |
13963578339 | multi line comment | /** **/ | 2 | |
13963579083 | Identifier | name for a variable, parameter, constant or user defined method/class | 3 | |
13963581427 | primitive types | int, double, boolean, char | 4 | |
13963584918 | does casting truncate or round | truncate | 5 | |
13963584919 | Largest int | 2^31-1 | 6 | |
13963585458 | Smallest int | -2^31 | 7 | |
13963586293 | n int storage | -2^n-1 to 2^n-1 - 1 | 8 | |
13963593166 | floating point numbers | sign ** mantissa ** radix/base (2) ^ exponent | 9 | |
13963595915 | roundoff error | whenever a normally true expression deals with repeating decimals or irrational numbers; when converting from floating point roundoff is highly likely | 10 | |
13963601631 | hexadecimal | 0-9 is A-F, google the rest | 11 | |
13963604404 | Oct | same as hex except base 8 | 12 | |
13963609264 | comparing floating point numbers | |x-y| <= ℰmax(|x|, |y|) | 13 | |
13963612277 | Arithmetic | +, -, *, /, % | 14 | |
13969259719 | bitwise | &, ! | 15 | |
13963614050 | Logical | &&, || | 16 | |
13963614496 | rational | ==, !=, >, < | 17 | |
13963615638 | Assignment | -, +=, -=, *= | 18 | |
13963616458 | Inc/Dec | ++/-- | 19 | |
13963617703 | mega precedence level 1 | !, ++, -- | 20 | |
13963618103 | mega precedence level 2 | *, /, % | 21 | |
13963618875 | mega precedence level 3 | +, - | 22 | |
13963619377 | mega precedence level 4 | <, >, <=, >= | 23 | |
13963620235 | mega precedence level 5 | ==, != | 24 | |
13969207773 | mega precedence level 6 | & | 25 | |
13969209496 | mega precedence level 7 | | | 26 | |
13963620936 | mega precedence level 9 | || | 27 | |
13963620236 | mega precedence level 8 | && | 28 | |
13963620937 | mega precedence level 10 | =, +=, -=, *=, /=, %= | 29 | |
13963624599 | encapsulation | Keeping 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 | |
13963625492 | static 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 method | 31 | |
13963626294 | static 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 variables | 32 | |
13963627571 | methods | public/private static/ void/int/string name (parameters) | 33 | |
13963628802 | constructors | sets default for class | 34 | |
13963629283 | accessor (getter) | Method that returns the current value of a specified data field. | 35 | |
13963629284 | mutator | A method used to change the value of an attribute of an object. | 36 | |
13963629975 | method overloading | The ability to define two or more different methods with the same name but different method signatures. | 37 | |
13963630823 | this keyword | an implicit parameter that ties an object to the instance called | 38 | |
13963633073 | primitve/other parameters | primitive 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 function | 39 | |
13963637137 | is-a | A phrase to say that something inherits from another, as in a "salmon" is-a "fish." | 40 | |
13963637938 | extend | inherits | 41 | |
13963638663 | inheritance doesn't take | private things or make private things public | 42 | |
13963641872 | Rules of a subclass 1 | A subclass can add new private/instance variables | 43 | |
13963643554 | Rules of a subclass 2 | A subclass can add new public, private or static methods | 44 | |
13963644437 | Rules of a subclass 3 | A subclass can override inherited methods | 45 | |
13963645040 | Rules of a subclass 4 | A subclass may not override static methods | 46 | |
13963645918 | Rules of a subclass 5 | A subclass must define its own methods | 47 | |
13963647131 | Rules of a subclass 6 | Subclass must use getters+setters | 48 | |
13963648427 | Polymorphism | polymorphism 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 | |
13963653945 | Dynamic binding | type of object is not determined until run-time | 50 | |
13963653946 | Static Binding | type of object is determined at compile time | 51 | |
13963655172 | Abstract Class | a class that defines attributes and methods for subclasses but is never instantiated | 52 | |
13963655902 | rules for abstract | you can't instantiate and you must implement all methods | 53 | |
13963662151 | interface rules | 1. 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 variables | 54 | |
13963665336 | Math.random | Generates a random floating point number between 0 & 1. double x = (highValue - lowValue) * Math.Random() + lowValue | 55 | |
13963672232 | primitive types rules | primitive types have a default value, but all other objects will not therefore they will result in a nullPointerException | 56 | |
13963678368 | Selection Sort | take 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 product | 57 | |
13963683802 | Insertion Sort | 58 | ||
13963687002 | Quick sort | take 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 | |
13963695423 | Sequential SOrt | essentially 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 elements | 60 | |
13963696225 | Binary Search | Basically 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 process | 61 |
AP CS Flashcards
Primary tabs
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!