๐ Local Classes
= a class that is defined in another class
Use cases
- define constants
๐ Example:
Definition
abstract class Emotical {
public class Moods // lokale Klassendefinition nur
{
// aus 'sprechenden' Konstanten public const short VeryBadMood = โ2;
public const short BadMood = โ1;
public const short NeutralMood = 0;
public const short GoodMood = 1;
public const short VeryGoodMood = 2;
}
Usage
Emoticon emot1 = new Emoticon(Emotical.Moods.GoodMood);