C# 3: Object Oriented Programming

Software Development

( 0 )
183 pages
The book deals with object-oriented programming in C# and how a running program consists of coop-erating objects.
This is a free eBook for students
Download free textbooks as PDF or read online. Less than 15% adverts
Business subscription free for the first 30 days, then $5.99/mo
Latest eBooks
About the author

Poul Klausen er uddannet cand. scient. i matematik fra Aarhus Universitet med speciale i algebraisk topologi. Efter universitetet og et efterfølgende pædagogikum har Poul Klausen primært arbejdet som underviser og det især inden for it uddannelser og gennem de sidste mange år som underviser på d


The book deals with object-oriented programming in C# and how a running program consists of coop-erating objects and how these objects are defined and created on basis of the program's classes. The book has focus on classes and how classes are used as the basic building blocks for developing a pro-gram. It is assumed that the reader has a basic knowledge of C# corresponding to the books C# 1 and 2 in this series.

Click here to download the source files from this book.

  • Foreword
  1. Introduction
    1. The type object
  2. Struct
    1. Exercise 1: A counter
    2. Nullable struct
    3. More on simple variables
    4. Exercise 2: Fibonacci numbers
  3. Enum
  4. More on classes and interfaces
    1. Visibility
    2. Design patterns
    3. Exercise 3: The Currency program
    4. Interfaces
    5. Exercise 4: Programming to an interface
    6. More students
    7. Exercise 5: A list of books
    8. Factories
    9. Exercise 6: A factory
  5. Inheritance
    1. Exercise 7: A loan calculator
    2. Problem 1: Number sequences
    3. Considerations about inheritance
    4. Problem 2: Geometric objects
    5. The composite pattern
  6. The class Object
  7. Exception handling
    1. System Exception
    2. The Exception class
    3. Exercise 8: Library exceptions
  9. More on C# syntax
    1. Automatic properties
    2. The index operator
    3. Object initializing
    4. The var keyword
    5. Expression bodied methods
    6. More about parameters
    7. Local methods
    8. More on operators
    9. Inner types
    10. Partial classes and methods
    11. Anonymous types
    12. Anonymous methods
    13. Tuples
    14. Extension methods
  10. Recursion
  11. A final example: A calculator
    1. Analysis
    2. The prototype
    3. Design
    4. Programming, first iteration
    5. Programming, second iteration
    6. The last iteration