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
| interface IPagadero | |
| { | |
| double Pagar(); | |
| } |
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 Propietario | |
| { | |
| private string cedula; | |
| public string Cedula | |
| { | |
| get { return cedula; } | |
| set { cedula = 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
| public static bool ValidarEmail(string direccionEmail) | |
| { | |
| try | |
| { | |
| MailAddress email = new MailAddress(direccionEmail); | |
| return true; | |
| } | |
| catch (FormatException fex) | |
| { |
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; | |
| public delegate void MiDelegado(); // declaración de delegado | |
| public interface I | |
| { | |
| event MiDelegado MiEvento; | |
| void Activar(); | |
| } |
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 SeguridadDeTipos | |
| { | |
| public static void Main() | |
| { | |
| // ejemplo con tipo string | |
| string cadenaDeTexto = "Texto de ejemplo"; | |
| String otraCadenaDeTexto = "...más texto"; | |
| // Al remover el comentario de la siguiente línea de código «Console.WriteLine...» | |
| // se produce el siguiente mensaje de error: |
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 OperacionesIlegales | |
| { | |
| public static void main() | |
| { | |
| int enteroSimple = 3; | |
| string cadenaDeTexto = "¡Hola Mundo!"; | |
| int division = enteroSimple / cadenaDeTexto; | |
| } | |
| } |
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 ConversionUnidades | |
| { | |
| public static void main() | |
| { | |
| int milimetros = 5; | |
| int centimetros = 10; | |
| // suma de unidades | |
| int suma = milimetros + centimetros; | |
| } |
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
| <?php | |
| $variable = 19; // tratada como entero | |
| echo $variable + 13; // imprime 42 | |
| $variable = "Hola, "; // variable tratada como cadena de texto | |
| echo "<br/>"; | |
| echo $variable; // imprime |
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 StaticVsDynamic | |
| { | |
| public static void main() | |
| { | |
| string variable = "Cadena de caracteres"; | |
| variable = 5; | |
| } | |
| } |
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 DynamicKeyword | |
| { | |
| public static void main() | |
| { | |
| dynamic d = 1; | |
| d = d + 3; | |
| System.Console.WriteLine(d); | |
| d = "Cadena de caracteres"; |