๐Ÿ• 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);