Skip to content

Instantly share code, notes, and snippets.

@comtom
Created April 8, 2014 23:52
Show Gist options
  • Select an option

  • Save comtom/10210500 to your computer and use it in GitHub Desktop.

Select an option

Save comtom/10210500 to your computer and use it in GitHub Desktop.
package turcobomber;
public class TurcoBomber {
public static void main(String[] args) {
System.out.println("Alumnos instanciados:");
// crea los objetos
pack.Alumno tomy = new pack.Alumno("Tomas", "Gonzalez Dowling", 28);
pack.Alumno flaco = new pack.Alumno("Juan", "Gonzalez Soler", 21);
// imprime nombre, apellido y edad convirtiendo en lower y upper
System.out.println( flaco.toString().toUpperCase() +" "+ flaco.getEdad() );
System.out.println( tomy.toString().toLowerCase() +" "+ Integer.toString(tomy.getEdad()) );
// elimina el objeto flaco y libera la memoria
flaco = null;
System.gc();
//flaco.setNombre("flaco... esto se rompe");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment