Java ap curriculum focus and java subset l.jpg
Sponsored Links
This presentation is the property of its rightful owner.
1 / 26

Java: AP Curriculum Focus and Java Subset PowerPoint PPT Presentation

  • Updated On :
  • Presentation posted in: General

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

Related searches for Java: AP Curriculum Focus and Java Subset

Download Presentation

Java: AP Curriculum Focus and Java Subset

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

Java ap curriculum focus and java subset l.jpg

Java: AP Curriculum Focusand Java Subset

Alyce Brady

Curriculum topics l.jpg

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 l.jpg

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 l.jpg

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 l.jpg

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 l.jpg

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 l.jpg

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 l.jpg

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 l.jpg

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 l.jpg

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 l.jpg

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 l.jpg

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 l.jpg

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 l.jpg

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 l.jpg

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 l.jpg

Java Subset (continued)

  • Inheritance and Interfaces

    • Implementing interfaces

    • Extending classes

      • inheriting data and methods

      • overriding methods

      • dynamic binding (polymorphism)

    • Abstract classes

Java subset continued17 l.jpg

Java Subset (continued)

  • Exceptions (unchecked exceptions)

    • Understand when they occur

    • NullPointerException, ArrayIndexOutOfBoundsException, ArithmeticException, ClassCaseException, IllegalStateException, NoSuchElementException

Java subset continued18 l.jpg

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 l.jpg

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 l.jpg

Standard Java Lists (java.util)

List (interface)

boolean add(Object x)

int size()

Iterator iterator()

ListIterator listIterator()


Object get(int index)

Object set(int index, Object x)

void add(int index, Object x)

Object remove(int index)


void addFirst(Object x)

void addLast(Object x)

Object getFirst()

Object getLast()

Object removeFirst()

Object removeLast()

Standard java sets java util l.jpg

Standard Java Sets (java.util)

Set (interface)

boolean add(Object x)

boolean contains(Object x)

boolean remove(Object x)

int size()

Iterator iterator()



Standard java lists java util22 l.jpg

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 l.jpg

Collections (NOT in Subset!)

Collection (interface)

boolean add(Object x)

boolean contains(Object x)

boolean remove(Object x)

int size()

Iterator iterator()


ListIterator listIterator()


Java subset ab additions24 l.jpg

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 l.jpg

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()



Java subset ab additions26 l.jpg

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

  • Login