java ap curriculum focus and java subset
Download
Skip this Video
Download Presentation
Java: AP Curriculum Focus and Java Subset

Loading in 2 Seconds...

play fullscreen
1 / 26

java: ap curriculum focus and java subset - PowerPoint PPT Presentation


  • 256 Views
  • Uploaded on

Java: AP Curriculum Focus and Java Subset. Alyce Brady. Curriculum Topics. Object-oriented programming and design Declaring and constructing objects Invoking methods Interacting objects Class implementations, including method implementations Parameter passing

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'java: ap curriculum focus and java subset' - Jimmy


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
curriculum topics
Curriculum Topics
  • Object-oriented programming and design
    • Declaring and constructing objects
    • Invoking methods
    • Interacting objects
    • Class implementations, including method implementations
      • Parameter passing
      • Basic control flow constructs
curriculum topics continued
Curriculum Topics (continued)
  • Data Structures
    • Primitive types
    • Classes
    • Arrays and ArrayLists
    • Maps and Sets (AB)
    • Stacks and Queues (AB)
    • Linked Lists (AB)
    • Trees (AB)
    • Heaps, Priority Queues (AB)
curriculum topics continued4
Curriculum Topics (continued)
  • Algorithms
    • Traversing Linear Data Structures
      • Accumulate
      • Find Min/Max
    • Searching (e.g., linear, binary)
    • Sorting
    • Traversing Linked Lists and Trees (AB)
    • Analyzing space and time performance (formal analysis -- AB)
ap java subset
AP Java Subset
  • Why have a subset?
    • Language is big; can’t cover everything.
    • Libraries are bigger; can’t cover everything.
    • Exam can’t test everything.
    • Exam should test fundamental ideas, not every esoteric (or interesting, or even useful) language construct.
  • Subset defines/limits what may be on the exam, not what you can cover.
java subset
Java Subset
  • Primitive Types (similar to C++)
    • int, double, boolean
    • arithmetic operators: + - * / % ++ --
    • relational & logical: == != < <= && || !
    • assignment: = += etc.
    • numeric casting: (int) (double), truncation
    • char is not required by subset
java subset continued
Java Subset (continued)
  • String class (similar to apstring)
    • Declaring and constructing strings
    • String constants
    • String concatenation (+)
      • converting numerics to strings
      • converting objects to strings (toString)
    • Escape sequences: \\ \” \n
java subset continued8
Java Subset (continued)
  • I/O
    • System.out.print, System.out.println
    • No other I/O will be tested, so you can use whatever techniques you and your textbook choose, e.g., keyboard input, text fields in graphical user interfaces, mouse events, applets, etc.
    • Case study also uses Debug.print, Debug.println
java subset continued9
Java Subset (continued)
  • Control Structures (similar to C++)
    • if, if - else, if - else if - else
    • for, while
    • return
  • Comments (similar to C++)
    • //
    • /* … */
    • Case study uses doc. comments /** … */
java subset continued10
Java Subset (continued)
  • Using Objects
    • Constructing objects using new, passing parameters to constructors as necessary
    • Variables are references to objects
    • Dot notation for invoking methods
    • Use of this to pass self to other objects
    • Difference between == and equals
    • null reference
java subset continued11
Java Subset (continued)
  • Defining Classes
    • public/private static final constants
    • private instance variables (data members)
    • public and private constructors and methods (member functions)
java subset continued12
Java Subset (continued)
  • Methods
    • Method calls and method definitions
    • Constructors, accessors, modifiers
    • Parameter passing (always pass-by-value, but passing references by value feels like pass-by-reference)
    • Method overloading; signature depends on number, type, order of parameters
    • super.method to call overridden method definition
java subset continued13
Java Subset (continued)
  • Constructors (similar to C++)
    • Name is same as class; no return value
    • Initialize instance variables in constructors (no initialization lists)
    • Call super to initialize inherited data
    • static constants are initialized when declared:

publicstaticfinalCONSTANT = init_expr;

java subset continued14
Java Subset (continued)
  • Standard Java Library Classes (A list)
    • java.lang.Object
    • java.lang.Comparable (AB only?)
    • java.lang.Integer, java.lang.Double
    • java.lang.String
    • java.util.ArrayList
    • java.lang.Math
    • java.util.Random
  • import statement
java subset continued15
Java Subset (continued)
  • Linear Indexed Data Structures
    • 1D (A) and 2D (AB) arrays, similar to apvector
      • bounds checking
      • myArray[i].length
      • 2D arrays are AB material
    • ArrayList class
      • Core subset of methods
      • Casting from Object to specific class (and casting more generally in other contexts)
java subset continued16
Java Subset (continued)
  • Inheritance and Interfaces
    • Implementing interfaces
    • Extending classes
      • inheriting data and methods
      • overriding methods
      • dynamic binding (polymorphism)
    • Abstract classes
java subset continued17
Java Subset (continued)
  • Exceptions (unchecked exceptions)
    • Understand when they occur
    • NullPointerException, ArrayIndexOutOfBoundsException, ArithmeticException, ClassCaseException, IllegalStateException, NoSuchElementException
java subset continued18
Java Subset (continued)
  • What is NOT in the subset (not testable)?
    • char
    • most I/O
    • main method (used in case study) and applets
    • do/while, switch, break
    • protected visibility (used in case study)
    • many other features
java subset ab additions
Java Subset (AB Additions)
  • Standard Java Library Classes
    • java.lang.Comparable (officially AB only)
    • java.util.List (interface)
    • java.util.ArrayList implements java.util.List
    • java.util.LinkedList implements java.util.List
    • java.util.Set (interface)
    • java.util.HashSet implements java.util.Set
    • java.util.TreeSet implements java.util.Set
    • java.util.Iterator
    • java.util.ListIterator extends java.util.Iterator
standard java lists java util
Standard Java Lists (java.util)

List (interface)

boolean add(Object x)

int size()

Iterator iterator()

ListIterator listIterator()

ArrayList

Object get(int index)

Object set(int index, Object x)

void add(int index, Object x)

Object remove(int index)

LinkedList

void addFirst(Object x)

void addLast(Object x)

Object getFirst()

Object getLast()

Object removeFirst()

Object removeLast()

standard java sets java util
Standard Java Sets (java.util)

Set (interface)

boolean add(Object x)

boolean contains(Object x)

boolean remove(Object x)

int size()

Iterator iterator()

HashSet

TreeSet

standard java lists java util22
Standard Java Lists (java.util)

Iterator (interface)

boolean hasNext()

Object next()

void remove()

ListIterator (interface)

void add(Object x)

void set(Object x)

collections not in subset
Collections (NOT in Subset!)

Collection (interface)

boolean add(Object x)

boolean contains(Object x)

boolean remove(Object x)

int size()

Iterator iterator()

List

ListIterator listIterator()

Set

java subset ab additions24
Java Subset (AB Additions)
  • Standard Java Library Classes
    • java.util.Map (interface)
    • java.util.HashMap
    • Java.util.TreeMap
    • java.lang.Object
      • int hashCode()
standard java maps java util
Standard Java Maps (java.util)

Map (interface)

Object put(Object key, Object value))

Object get(Object key)

boolean containsKey(Object key)

int size()

Set keySet()

HashMap

TreeMap

java subset ab additions26
Java Subset (AB Additions)
  • AP CS ListNode and TreeNode Classes
  • Interfaces for Stack, Queue, PriorityQueue
    • There is a java.util.Stack class, but this is not the same as the AP interface and is not in the subset
ad