C# Call a Constructor Overload from the Default Constructor


/ Published in: C#
Save to your folder(s)

This is stupidly simple, but I always forget it.


Copy this code and paste it in your HTML
  1. public class State
  2. {
  3. public State() :this(5)
  4. {
  5. }
  6.  
  7. public State(int numberOfNodes)
  8. {
  9. //create nodes
  10. }
  11. }

Report this snippet


Comments


You need to login to view comments.