Created
July 30, 2015 20:53
-
-
Save diegozr1/559f529350f0e5aded06 to your computer and use it in GitHub Desktop.
A simple application of OOP with Java
This file contains 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 class Saludo{ | |
private String name; | |
public Saludo(){ | |
this.name = "Default"; | |
} | |
public Saludo(String name){ | |
this.name = name; | |
} | |
public String toString(){ | |
return "Saludos a la persona llamada "+this.name; | |
} | |
public static void main(String[] args) { | |
Saludo s = new Saludo(); | |
System.out.println(s); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment