❔ hi everyone what
i need help in c#
what is get and set ,
and what is a args,
and sender? any body can help me!
what is get and set ,
and what is a args,
and sender? any body can help me!
get and set are "accessors" for properties. you can individually assign logic to them to verify input and output for them. you can also omit one or the other, or give one a different accessibility$StructureOldargs is usually a string[] or an object[] (string array, object array) that gets passed into the entry point of the program (the Main) method. it doesn't need to be there, but it can. for console apps, the args will be all additional information passed into the execution of your programMain are public is not required (can be any accessibility).Main method and will use an appropriate signature depending on whether args is referenced, the await operator is used and/or an explicit return statement is used.
YourProgram.exe arg1 arg2args array will be a string[] where item 0 is "arg1" and item 1 is "arg2"sender (in the context of a winforms app) is the object which caused the invocation (raising, execution) of the eventsender will be the Slider which raised the OnSliderValueChanged event/close public static void Main() { }
public static int Main() { }
public static void Main(string[] args) { }
public static int Main(string[] args) { }
public static async Task Main() { }
public static async Task<int> Main() { }
public static async Task Main(string[] args) { }
public static async Task<int> Main(string[] args) { }$StructureOldobject[]YourProgram.exe arg1 arg2"arg1""arg2"SliderOnSliderValueChangednamespace Namespace;
[Attribute]
public class Class
{
public string PublicField;
private bool _privateField;
protected double protectedField;
public int PublicProperty { get; set; }
public Class() {} // Constructor
public void Method(int parameter)
{
var localVariable = parameter;
}
}private int _intProperty;
public int IntProperty
{
get
{
return _intProperty; // this will return _intProperty's current value
}
set
{
if (value <= 100) // `value` here is the actual value the user passed in when they did `IntProperty = 42` (42)
{
_intProperty = value;
}
else
{
// don't allow values larger than 100
throw new ArgumentOutOfRangeException();
}
}
}public int IntProperty { get; private set; }void OnSliderValueChanged(object sender, ValueChangedEventArgs args)