Using .Net Framework 4.0
I am brand new 2 programming and learning how to write programs in C# while practicing some exercise I'm getting this error:
Properties.Dog.Color.get' must declare a body because it is not marked abstract or extern. Automatically implemented properties must define both get and set accessors. H:\Documents and Settings\noname\Desktop\C# Oreilly\ConsoleApplication1\ConsoleApplication2\Program.cs 17 13 ConsoleApplication2
I cannot seem to figure it out
Code:using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace properties { public class Dog { private int weight; private string color; public string Color { get { return color; } set { color = value; } } public Dog(int myWeight, string myColor) { weight = myWeight; color = myColor; } } public class Tester { static void Main( ) { } } }




Reply With Quote