static void Main(string[] args) { MediaPlayer myPlayer = new MediaPlayer(); myPlayer.Play(); ReadLine(); }
static void Main(string[] args) { MediaPlayer myPlayer = new MediaPlayer(); myPlayer.Play(); MediaPlayer youPlayer = new MediaPlayer(); AllTracks yourMusic = youPlayer.GetAllTracks(); Console.ReadLine(); }
static void Main( string[] args ) { Console.WriteLine("***** Fun with Lazy Instantiation *****\n"); // No allocation of AllTracks object here! MediaPlayer myPlayer = new MediaPlayer(); myPlayer.Play(); // Allocation of AllTracks happens when you call GetAllTracks(). MediaPlayer yourPlayer = new MediaPlayer(); AllTracks yourMusic = yourPlayer.GetAllTracks(); Console.ReadLine(); }
static void Main(string[] args) { MediaPlayer mp = new MediaPlayer(); mp.Play(); mp.GetAllTracks(); Console.ReadLine(); }