Answer: </P><P align=justify>Yes. Here's a simple example: using System;</P><P align=justify></P><P align=justify>class Class1 </P><P align=justify>{</P><P align=justify>private string[] MyField;</P><P align=justify></P><P align=justify>public string[] MyProperty </P><P align=justify>{</P><P align=justify>get { return MyField; }</P><P align=justify>set { MyField = value; }</P><P align=justify>}</P><P align=justify>}</P><P align=justify></P><P align=justify>class MainClass</P><P align=justify>{</P><P align=justify>public static int Main(string[] args) </P><P align=justify>{</P><P align=justify>Class1 c = new Class1();</P><P align=justify></P><P align=justify>string[] arr = new string[] {"apple", "banana"};</P><P align=justify>c.MyProperty = arr;</P><P align=justify>Console.WriteLine(c.MyProperty[0]); // "apple"</P><P align=justify></P><P align=justify>return 0;</P><P align=justify>}</P><P align=justify>}
Tags:Interview Questions, Microsoft, C#,
Please submit your Interview Answer for the above Question via replying to this post. Thank you for visiting to our blog, Have a Good Day!.
Sponsor Advertisement
Hotel Management System Software
Hotel Management System software is a web based system help to manage reservations, roomstays, bookings, guests, folios, invoices and billing etc. The software features include revenue management, booking calendar, guest relationship management, check-in & check-out, invoices and receipts etc...
No comments:
Post a Comment