lecture12

lecture12 - Computer Science 111 Lecture 12 Objects CS111:...

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

View Full Document Right Arrow Icon
CS111: Slides for Prof. Steinberg ʼ s lecture 1 Lecture 07 Computer Science 111 Computer Science 111 Lecture 12 Objects
Background image of page 1

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

View Full DocumentRight Arrow Icon
CS111: Slides for Prof. Steinberg ʼ s lecture 2 Lecture 07 Exam Sunday Exam Sunday Midterm Exam is Sunday Oct. 17 Time: 1:30 - 3:00 pm Place: ARC 103 See Remus web page “Exam materials” guide
Background image of page 2
CS111: Slides for Prof. Steinberg ʼ s lecture 3 Lecture 07 Review: Static methods Review: Static methods A way to write code once and have it executed multiple times A method is executed whenever it is called Invoked is a synonym for called When a method is called, the computer goes and does the method, then comes back to where the call was from and continues
Background image of page 3

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

View Full DocumentRight Arrow Icon
CS111: Slides for Prof. Steinberg ʼ s lecture 4 Lecture 07 Calling a Static Method Calling a Static Method requestGrade ( ) ;
Background image of page 4
CS111: Slides for Prof. Steinberg ʼ s lecture 5 Lecture 07 Calling a Static Method Calling a Static Method requestGrade ( ) ; Method name Parens Arguments (none)
Background image of page 5

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

View Full DocumentRight Arrow Icon
CS111: Slides for Prof. Steinberg ʼ s lecture 6 Lecture 07 Calling a Calling a Static Static Method Method area = annulusArea ( innerRadius ) ; Method name Parens Arguments
Background image of page 6
CS111: Slides for Prof. Steinberg ʼ s lecture 7 Lecture 07 Arguments Arguments Zero or more pieces of data can go to a static method when it is called Each argument is an expression If 2 or more, separate by , foo(4, x+2.3, “foo”) Even if 0 arguments still need parens
Background image of page 7

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

View Full DocumentRight Arrow Icon
Slides for Prof. Steinberg ʼ s lecture 8 Lecture 07 Return Value Return Value Zero or one piece of data can come back from a static method when it returns If zero (a
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.

Page1 / 28

lecture12 - Computer Science 111 Lecture 12 Objects CS111:...

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