Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Generics
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public class EntityNotFoundException<T> : Exception {} public class EntityStore<T> { public T GetEntity(int key) { throw new EntityNotFoundException<T>(); } } public class PlayerEntity {} //... public static void Main(string[] args) { EntityStore<PlayerEntity> entityStore = new EntityStore<PlayerEntity>(); try { entityStore.GetEntity(6); } catch (EntityNotFoundException<PlayerEntity>) { Console.WriteLine("Player not found."); } catch (Exception) { Console.WriteLine("Unexpected error."); } } } }
run
|
edit
|
history
|
help
0
Ejemplos polimorfismos con interfaces y posibles usos sencillos c#
DateTime With TimeZone to UTC DateTime
buble sort
EX8 Loop_For_While
Intuit // C# // listing_4.4 (StreamReader // output.txt + Convert/Parse)
a6
sdefuy6j87uytgraxsd
hh
BreakNum
Golden Ratio Approximation