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 A | |
{ | |
~A() | |
{ | |
Console.WriteLine("Destruye instancia de A"); | |
} | |
} | |
class B | |
{ |
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
private int FuncionSumaLenta(int a, int b) | |
{ | |
System.Threading.Thread.Sleep(5000); | |
return a + b; | |
} |
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
private async void btnCalcular_Click(object sender, EventArgs e) | |
{ | |
this.btnCalcular.Enabled = false; | |
var tarea = Task<int>.Factory.StartNew(() => FuncionSumaLenta(Int32.Parse(txtNumeroA.Text),Int32.Parse(txtNumeroB.Text))); | |
await tarea; | |
this.lblResulado.Text = "Resultado: " + tarea.Result.ToString(); | |
this.btnCalcular.Enabled = true; |
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; // Importaci贸n de namespace | |
class Prueba // Declaraci贸n de clase | |
{ | |
static int Main(string[] args) // Declaraci贸n de m茅todo | |
{ | |
int x = 12 * 30; // Sentencia 1 | |
Console.WriteLine(x); // Sentencia 2 | |
} // Fin del m茅todo | |
} // Fin de la clase |
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 void Suma(double valorA, double valorB) |
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 double Suma(double valorA, double valorB) | |
{ | |
double suma = valorA + valorB; | |
return suma; | |
} |
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 Prueba | |
{ | |
static void Main() | |
{ | |
Console.WriteLine(PiesAPulgadas(30)); // 360 | |
Console.WriteLine(PiesAPulgadas(100)); // 1200 | |
} | |
static int PiesAPulgadas(int pies) | |
{ |
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 int PiesAPulgadas(int pies) |
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() | |
{ | |
Console.WriteLine(PiesAPulgadas(30)); // 360 | |
Console.WriteLine(PiesAPulgadas(100)); // 1200 | |
} |
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() | |
static void Main(string[] args) | |
static int Main() | |
static int Main(string[] args) |