Slides0223 - COP 3330 Slides 2/23 Topics Assignment #3...

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

View Full Document Right Arrow Icon
Slides 2/23 COP 3330
Background image of page 1

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

View Full DocumentRight Arrow Icon
Topics Assignment #3 posted protected visibility modifier Final classes and methods enum
Background image of page 2
Assignment #3 Assignment #3 handed out in class Assignment #3 is also available via WebCourses
Background image of page 3

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

View Full DocumentRight Arrow Icon
protected protected is a visibility modifier (like private and public ) that is used to make fields and methods visible only to subclasses
Background image of page 4
Final Classes/Methods Classes declared as final can't be extended Methods declared as final can't be overridden
Background image of page 5

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

View Full DocumentRight Arrow Icon
Final Classes/Methods Example public final class foo{ public void bar(){ System.out.print("bar can't be overridden"); System.out.println(" because foo is final"); } } Example public class foo{ public final void bar(){ System.out.print("bar can't be overridden"); System.out.println(" because bar is final"); } }
Background image of page 6
Final Classes/Methods Why make classes and methods final? - Protect the integrity of a program (Some methods might do something very important, but confusing) - Prevent other developers from extending your code for financial gain
Background image of page 7

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

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 14

Slides0223 - COP 3330 Slides 2/23 Topics Assignment #3...

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

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