Posted By

rengber on 04/14/09


Tagged

simple c tip Contstructor


Versions (?)

Who likes this?

6 people have marked this snippet as a favorite

maishar
paelgr
umang_nine
rodrigojuarez
Tomjohnson
danfinrud55


C# Call a Constructor Overload from the Default Constructor


 / Published in: C#
 

This is stupidly simple, but I always forget it.

  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  

You need to login to post a comment.