Created
September 4, 2013 19:58
-
-
Save tedyblood/6442075 to your computer and use it in GitHub Desktop.
// Ejemplo "Hola Mundo" en Java
// Programa fuente: Greeting.java
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
// | |
// Ejemplo "Hola Mundo" | |
// Programa fuente: Greeting.java | |
// | |
// Declaraci?n de la clase Greeting. | |
public class Greeting { | |
private String salutation; | |
// M?todo constructor Greeting( ) | |
Greeting ( String s ) { | |
salutation = s ; | |
} | |
// M?todo greet( String whom ) | |
public void greet( String whom ){ | |
System.out.println( salutation + " " + whom); | |
} | |
} |
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
// | |
// Ejemplo "Hola Mundo" | |
// Programa fuente: TestGreeting.java | |
public class TestGreeting{ | |
public static void main ( String [] args){ | |
Greeting hello = new Greeting("Hola"); | |
hello.greet("Mundo"); | |
} | |
} |
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
// | |
// Ejemplo "Hola Mundo" | |
// Programa fuente: TestGreeting.java | |
public class TestGreeting2{ | |
public static void main ( String [] args){ | |
Greeting hello = new Greeting("Hola"); | |
hello.greet("Mundo"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment