chapter 10 classes and objects a deeper look n.
Download
Skip this Video
Download Presentation
Chapter 10 Classes and Objects: A Deeper Look

Loading in 2 Seconds...

play fullscreen
1 / 44

Chapter 10 Classes and Objects: A Deeper Look - PowerPoint PPT Presentation


  • 115 Views
  • Uploaded on

Chapter 10 Classes and Objects: A Deeper Look. C lasses. Classes are not just containers for methods Virtually all are classes Blueprint/Cookie Cutter/Recipe Objects – instance of the class (new) Type “prop” tab tab OOP – vast topic. 10.2 Time Class Case Study.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Chapter 10 Classes and Objects: A Deeper Look' - penha


Download Now 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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
c lasses
Classes
  • Classes are not just containers for methods
    • Virtually all are classes
    • Blueprint/Cookie Cutter/Recipe
    • Objects – instance of the class (new)
    • Type “prop” tab tab
  • OOP – vast topic
slide5

Formatting: http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx

Padding: http://msdn.microsoft.com/en-us/library/txafckwd.aspx

slide10

Class

public A

protected B

internal C

private D

Class

public A

protected B

internal C

private D

SubClass

(outside package)

public A

protected B

internal C

private D

SubClass

public A

protected B

internal C

private D

private D

Class

(outside package)

public A

protected B

internal C

private D

ASSEMBLY

10 5 time class case study overloaded constructors
10.5 Time Class Case Study: Overloaded Constructors

It's the marker for Inheritance and/or the constructor call chain.

what is the difference between const and static readonly
What is the difference between constand static readonly?
  • static readonly field is set at run time, and can thus be modified by the containing class
  • the value of a const field is set to a compile time constant.
  • In the staticreadonlycase, the containing class is allowed to modify it only in the variable declaration (through a variable initializer) in the static constructor (instance constructors, if it's not static)
  • staticreadonlyis typically used if the type of the field is not allowed in a const declaration, or when the value is not known at compile time.
  • Instancereadonly fields are also allowed. 
  • Remember that for reference types, in both cases (static and instance) the readonly modifier only prevents you from assigning a new reference to the field.  It specifically does not make immutable the object pointed to by the reference.