This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace PruebaProgramas | |
{ | |
class Prueba{ } | |
class Prueba2{ } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class MiPrimerPrograma | |
{ | |
static void Main() | |
{ | |
Console.WriteLine("Mensaje mostrado en la salida est谩ndar."); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class EstudioSintaxisCSharp | |
{ | |
static void Main() | |
{ | |
int x = 12 * 30; | |
Console.WriteLine(x); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class class {...} // Ilegal | |
class @class {...} // Legal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
class DemoPalabrasReservadasContextuales | |
{ | |
static void Main() | |
{ | |
int var = 1; | |
int select = 10; | |
var resultado = from value in Enumerable(5, 5) select value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class ConvertidorUnidades | |
{ | |
int unidades; // Campo | |
public ConvertidorUnidades(int unidadesConversion) // Constructor | |
{ | |
unidades = unidadesConversion; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Panda | |
{ | |
public string Nombre; // Campo de instancia | |
public static int Poblacion; // Campo est谩tico | |
// Constructor | |
public Panda(string n) | |
{ | |
Nombre = n; // Asignaci贸n al campo de instancia | |
Poblacion = Poblacion + 1; // Incremento al campo est谩tico Poblaci贸n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Clase cliente para prueba de clase ConvertidorUnidades | |
class PandaPrueba | |
{ | |
static void Main() | |
{ | |
Panda p1 = new Panda("Pan Dee"); | |
Panda p2 = new Panda("Pan Dah"); | |
Console.WriteLine(p1.Nombre); // Pan Dee | |
Console.WriteLine(Panda.Poblacion); // 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct Punto | |
{ | |
public int X; // representa la abscisa en el plano | |
public int Y; // representa la ordeanda en el plano | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void Main() | |
{ | |
Punto punto1 = new Punto(); | |
punto1.X = 7; | |
Punto punto2 = punto1; // La asignaci贸n crea una copia | |
Console.WriteLine(punto1.X); // 7 | |
Console.WriteLine(punto2.X); // 7 |