Tech Tutorials Database
GeekArticles Microsoft C#
 

Structures In C#

 
Author: csharphelp.com
Category: C#
Comments (0)

By KL Structures in C#: - ==================== Example: - ========== class TestStruct { public static void Main() { SimpleStruct st = new SimpleStruct(4); System.Console.WriteLine(st.i); st.aMethod(); } } struct SimpleStruct { public int i; public SimpleStruct(int j) { i=j; } public void aMethod() { System.Console.WriteLine("Inside aMethod"); } } O/P 4 Inside aMethod Features of Structures: - ========================== * A structure or struct can contain only fields, methods, Etc., * In...n

Read More...




Sponsored Links




Read Next: C# Interface Implementation



 

 

Comments