prelim1-review

prelim1-review - CS 2110 Review Click to edit Schultz...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
9/30/11 Click to edit Master subtitle style Johnathon Schultz 10.13.10 (with excerpts from The Brief, Incomplete and Largely Inaccurate History of Programming Languages) CS 2110 Review
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
9/30/11 Prelim information Prelim 1: TOMORROW at 7:30 PM Review session – Tonight 7:30 PM, Phillips 101 (or now?) Things you should do: Review every practice prelim #1 Review practice finals (ignore questions that cover topics you haven’t learned yet) Review quizzes Review lecture slides
Background image of page 2
9/30/11 Material Covered Types Recursion (including grammars) Lists and Trees How Java Works Software Design Patterns Easy Big O Not Covered: GUI Induction
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
9/30/11 Java basics 1996 - James Gosling invents Java. Java is a relatively verbose, garbage collected, class based, statically typed, single dispatch, object oriented language with single implementation inheritance and multiple interface inheritance. Sun loudly heralds Java's novelty. 2001 - Anders Hejlsberg invents C#. C# is a relatively verbose, garbage collected, class based, statically typed, single dispatch, object oriented language with single implementation inheritance and multiple interface inheritance. Microsoft loudly heralds C#'s novelty.
Background image of page 4
9/30/11 Primitive and reference types Primitive types int, double, boolean, char, long, short, float, byte compare with == Reference types Everything else – anything that is an object type String, HashMap, Integer Arrays are reference types compare with .equals() 1980 - Alan Kay creates Smalltalk and invents the term "object oriented." When asked what that means he replies, "Smalltalk programs are just objects." When asked what objects are made of he replies, "objects." When asked again he says "look, it's all objects all the way down. Until you reach turtles."
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
9/30/11 == vs. .equals() == Compares the contents of two variables For primitive types, this is the actual data For reference types, this is the reference, not the object Two variables are == if they point to the same object Two different objects with the same contents are not == different location in memory equals() is the smarter version Looks at the contents of the objects Need to override equals() if you create a new class
Background image of page 6
9/30/11 Pass by value / reference Primitive types Java copies the data itself; original data is unchanged Pass by value Reference types Java makes a copy of the reference to the object Both references point to the same object Changes affecting the object are permanent If new reference changes, old reference is unchanged Pass by reference
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
9/30/11 interfaces Outline of a class Methods in an interface must be implemented in any class that implements that interface For example: Interface Iterable If another programmer looks at your class and sees you implemented Iterable, they know for a fact that they can iterate through an object of
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/30/2011 for the course CS 2110 taught by Professor Francis during the Fall '07 term at Cornell.

Page1 / 39

prelim1-review - CS 2110 Review Click to edit Schultz...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online