1 / 19

Quizz Results

Quizz Results. Go over quizz quesitons. Bing (96/100) and Minsik (96/100) to explain answers. I will not record your grade, if I don't get the quizz back. Elipses. int... passed into method as int[] Object... passed into method as Object[] Date... passed into method as Date[] etc.

jmagnus
Download Presentation

Quizz Results

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Quizz Results

  2. Go over quizz quesitons • Bing (96/100) and Minsik (96/100) to explain answers. • I will not record your grade, if I don't get the quizz back.

  3. Elipses • int... passed into method as int[] • Object... passed into method as Object[] • Date... passed into method as Date[] • etc.

  4. Casting • Casting down may be done ONLY down the class hierarchy. • Casting up is not required because a subclass object may always be stored in a superclass reference (or an interface that it implements).

  5. Reflection • If your program is written well and adheres to the principals of polymorphism, then you don't really need reflection. • It's nice to know you have it when testing/debugging though.

  6. Recursion • Often times recursion is simpler than iteration. • Certain applications require recursion, such as binary trees. • Let's see some examples.

  7. Intro to Data Structures in Java • Single Lined List • Stack • Binary Tree • others...

  8. Inner and Anonymous Classes • Though you are captive in the OO paradigm, you can use inner classes and anonymous classes to get around this constraint and write procedural-like code. • Often times, no one but the enclosing class cares about an object. In this case, you may consider using inner or anonymous classes.

  9. WindowsBuilderPro by Google • http://download.eclipse.org/windowbuilder/WB/release/R201109201200/3.7/ • b,y,c,n,s,l,d,f,str; get rid of these in Window || Preferences || Java || Code Style || Fields. Otherwise, they will hose you in WB.

  10. Constructors • Constructors are optional. If your class is just a static driver; i.e. it just has a static main method, then no need to instantiate it; and no need for constructor. • If your class is a "java bean" -- a class that models a real world object (noun) in your system, then it should have a constructor. House, Car, Person, etc. • If you don't provide a constructor, a no-args constructor is provided automatically. • You can, and often want, more than one constructor with different signatures. • You call a constrcutor with the 'new' keyword.

  11. Model a system • Object-oriented programming is about modelling a system. • Write the problem out as requirements -- this will essentially be a math world problem (your favorite kind to solve!) • Your computer objects map directly to real-world objects (nouns). • Your methods map directly to real-world actions (verbs).

  12. Write a very simple application for a contact manager. The the sake of simplicity, each contact will have a name and a phone number only. The user should be able to create new contacts and diplay all contacts. Build a GUI using WindowBuilder and Swing.

  13. Interfaces • A class implements an interface rather than extends it. Any class that implements the interface must override all the interface methods with it's own methods. • Interface names often end with "able" to imply that they add to the capabilty of the class. • An interface is a contract; it defines the methods

  14. Class Objects

  15. The ColorSelector GUI App

  16. The Leet Translator GUI App

More Related