DOC PREVIEW
Object Interaction(Ch3)

This preview shows page 1-2-3 out of 9 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Problem SolvingClock ExampleSoftware DiagramsSource CodeLogic OperatorsConstructorsMethod callsMail System ExampleDebuggingcopyright by Scott Grissom Ch 3 Object Interaction Slide 1 Problem Solving•Complex solutions are often divided into smaller piecesCar engineRegistration processPlumbing systemWriting a book•Abstraction is the ability to ignore details and focus on higher level conceptsStarting a car•Mudularization is the process of dividing large things into smaller partscopyright by Scott Grissom Ch 3 Object Interaction Slide 2 Clock Example•Display 18:42•Consider two pieces that have similar behavior•public class NumberDisplay{int limit;int value;}public class ClockDisplay{NumberDisplay hours;NumberDisplay minutes;}copyright by Scott Grissom Ch 3 Object Interaction Slide 3 Software Diagrams•We are not interested in class diagrams•Object diagrams help us visualize the contents of an objectcopyright by Scott Grissom Ch 3 Object Interaction Slide 4 Source Code•see examples on pages 57 & 63•Primitive Typespre-defined in Javadata onlyint, double, booleancopyright by Scott Grissom Ch 3 Object Interaction Slide 5 Logic Operators•More complex boolean values•and && (both are true)•or || (at least one is true)•not ! (invert)•Examplesif (x > 0 && x <= 10)copyright by Scott Grissom Ch 3 Object Interaction Slide 6 Constructors•sets the object to its initial state•no return type•name is same as class name•default constructor has no parameters•sometimes have parameters•overloaded methods share the same name but have different parameterscopyright by Scott Grissom Ch 3 Object Interaction Slide 7 Method calls•also called invoking•internal methods only require the method name•external methods require an object AND the method namecopyright by Scott Grissom Ch 3 Object Interaction Slide 8 Mail System Example•Review the source codecopyright by Scott Grissom Ch 3 Object Interaction Slide 9 Debugging•BlueJ allows you to inspect the contents of objects and source code•set a breakpoint•single step through code•step into a


Object Interaction(Ch3)

Download Object Interaction(Ch3)
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Object Interaction(Ch3) and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Object Interaction(Ch3) 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?