Mega Code Archive

 
Categories / C# Book / 01 Language Basics
 

0095 Multiple fields declaration

For the fields with the same type we can declare them together. class Rectangle{ int Width, Height; } They can share the same modifiers as well. class Rectangle{ public int Width, Height; }