Lenguajes de Programación
https://xamarin.com/
Robotics
Manifest constants
vrs
Elaboration-time constants
public const string ConnectionString = "YourConnectionString";
public class TestClass
{
public readonly string ConnectionString = "TestConnection";
public TestClass()
{
ConnectionString = "DifferentConnection";
}
public void TestMethod ()
{
ConnectionString = "NewConnection";//Will not compile
}
}
using System;
public class Customer
{
private int m_id = -1;
public int GetID()
{
return m_id;
}
public void SetID(int id)
{
m_id = id;
}
private string m_name = string.Empty;
public string GetName()
{
return m_name;
}
public void SetName(string name)
{
m_name = name;
}
}
public class CustomerManagerWithAccessorMethods
{
public static void Main()
{
Customer cust = new Customer();
cust.SetID(1);
cust.SetName("Amelio Rosales");
Console.WriteLine(
"ID: {0}, Name: {1}",
cust.GetID(),
cust.GetName());
Console.ReadKey();
}
}
using System;
public class Customer
{
private int m_id = -1;
public int ID
{
get
{
return m_id;
}
set
{
m_id = value;
}
}
private string m_name = string.Empty;
public string Name
{
get
{
return m_name;
}
set
{
m_name = value;
}
}
}
public class CustomerManagerWithProperties
{
public static void Main()
{
Customer cust = new Customer();
cust.ID = 1;
cust.Name = "Amelio Rosales";
Console.WriteLine(
"ID: {0}, Name: {1}",
cust.ID,
cust.Name);
Console.ReadKey();
}
}
public class Container
{
public class Nested
{
private Container parent;
public Nested()
{
}
public Nested(Container parent)
{
this.parent = parent;
}
}
}
public partial class Employee
{
public void DoWork()
{
}
}
public partial class Employee
{
public void GoToLunch()
{
}
}