Presentation is loading. Please wait.

Presentation is loading. Please wait.

SE1011 Week 6, Class 1 Today Return Half Exam 2 (cont.) Object Oriented Programming (cont.) Muddiest Point Next Half Exam: Week 7, Monday SE-1011 Slide.

Similar presentations


Presentation on theme: "SE1011 Week 6, Class 1 Today Return Half Exam 2 (cont.) Object Oriented Programming (cont.) Muddiest Point Next Half Exam: Week 7, Monday SE-1011 Slide."— Presentation transcript:

1 SE1011 Week 6, Class 1 Today Return Half Exam 2 (cont.) Object Oriented Programming (cont.) Muddiest Point Next Half Exam: Week 7, Monday SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 1

2 Muddiest Point How the class return the value to the main program? How to choose this variables to be returned?return value how to use the info we generated in clock ideas into separate pieces of codedesign to code formatter versus printfformatter How does any of this actually work? seeing Clock in action would have helped.clock in action Hardest part to me would be what is "private" exactly?public/private Where to create a new class for an object, and when to incorporate that info into the main classmultiple classes The first part of the lecture, how to differentiate between an object and an instance o a classobject/instance 2

3 Muddiest Point (2) more uses for formater?formatter Java standards on what to make public and what to make privatepublic/private do you have to make a separate class for the objects you create? multiple classes how are you supposed to get the clock to count and show on its own.clock in action public vs. private\public/private What exactly is an address? Are they useful?address should the lab be in console or GUI?lab 5 Are methods just functions in a class?methods 3

4 IEEE Xtreme Competition 24 hour programming competition Deadline for registration is tomorrow – see your email I will proctor a few hours of the competition If you have prior programming experience, I recommend the competition If you have lots of free time, I also recommend it, regardless of your experience level SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 4

5 Object Oriented Programming Why use object oriented programming (OOP)? Natural way to model real-world objects describe computing components Encapsulation! Present clean interface and behavior to users Users don't have to know internals to use Helps detect and correct for errors SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 5

6 What is an Object? A class defines a new type of object An object is an instance of a class with its own values for instance variables behaviors performed using its own instance variables Unlike primitive … types, class types are defined based on other types, and define behaviors values, objects have behaviors variables, a variable with a class type actually holds a reference, not the object directly 6

7 How to copy a class? SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 7 12 inputHour int 285638 Clock 11 hours int 3131 minute int 285652 Clock 11 hours int 3131 minute int SE1011 Week 6, Class 1 Clock ref clock Clock ref clock2 285638 285652 main(…)

8 SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 8

9 Acknowledgement This course is based on the text Introduction to Programming with Java by Dean & Dean, 2 nd Edition SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 9


Download ppt "SE1011 Week 6, Class 1 Today Return Half Exam 2 (cont.) Object Oriented Programming (cont.) Muddiest Point Next Half Exam: Week 7, Monday SE-1011 Slide."

Similar presentations


Ads by Google