Create your own awesome maps

Even on the go

with our free apps for iPhone, iPad and Android

Get Started

Already have an account?
Log In

OOP i C# by Mind Map: OOP i C#
0.0 stars - 0 reviews range from 0 to 5

OOP i C#

Klasser

[Accessor] class ClassName { // class contents }

Public

No access restrictions

Private

The class is only accessible from within its declaration context.

Protected

The class is only accessible from within its own class or derived classes.

Internal

The class is only accessible from within the assembly that contains it.

Protected internal

The class is only accessible from within its own class, a derived class, or its containing assembly.

constructor

special method that runs when the class is instantiated

Har samme navn som klassen

Overloading

Har flere constructors

Ulik signatur, Ulikt antall parametre

Properties

control the characteristics of a class,

expose to users of the class some internal values

public int ProductID { get{ return _ProductID; } set{ _productID = value; } }

int pid = item.ProductID;

item.ProductID = 123;

abstraction.

Skjule intern funksjonalitet

Syntaks

Property Item

intern variabel _item

Methods

[Accessor] DataType FunctionName([parameters]) { return value }

Uten returverdi void

override

a new implementation of a member that is inherited from a base class

polymorphism,

Shared class members

Static memebers

A class instance is not required,

[Accessor] static returntype Name()

Inheritance

partial class NewClass:DerivedClass

virtual method

inheriting classes can override the method and provide their own implementation.

Member Access

protected member

is accessible within its class and by derived classes

Scope and lifetime

Variabler lever innen den kode blokken den er definert

Generics

let you tailor a method, class, structure, or interface to the precise data type it acts upon

List<Custom Class> name