View Single Post
  #2  
Old 09-27-2011, 06:42 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

simply said get; and set; are short versions for class design.

example:

public class test()
{
public string Name {get; set;}
}

so you can use:
test newobject = new test();

newobject.Name = "test1"; // this is the set
string test2 = newobject.Name; // this is the get


the long version

public class test()
{
private string name;

public void SetName (string newname)
{
name = newname;
}

public string GetName ()
{
return name;
}
}
so you must use:
test newobject = new test();

newobject.SetName("test1");
string test2 = newobject.GetName();

only a simple example.
Reply With Quote