No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
[CODE]class point { private double pi; public double PI { get{ return pi; } set{ pi = value;} } } class Program { static void Main(string[] args) { point p1=new point(); p1.PI = 3.14; Console.WriteLine("The value is {0}",p1.PI); Console.ReadLine(); } }[/CODE] Actually i couldn't understand the use of PROPERTIES concept.... … |
|
While i used this code i got the [COLOR="Green"]output[/COLOR] as [COLOR="Green"]"The value is 0"[/COLOR] [CODE] int var1 = 2147483647;// Maximum limit of int short var2; var2 =(short)var1; var2 +=1; Console.WriteLine("The value is {0}",var2);[/CODE] I got [COLOR="red"]error : Cannot implicitly convert type 'int' to 'short'[/COLOR] while i tried to use [COLOR="Red"]var2 … |