Skip to content

Instantly share code, notes, and snippets.

@areee
Last active March 14, 2019 11:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save areee/2a64e23d43e14de5d344ff643d6c3b95 to your computer and use it in GitHub Desktop.
Save areee/2a64e23d43e14de5d344ff643d6c3b95 to your computer and use it in GitHub Desktop.
Nisäkäs-luokan pääohjelma
public class Hiekkalaatikko {
public static void main(String[] args) {
Nisakas n1 = new Nisakas("Liisa", 18, "sininen"); // oletuslaji: ihminen
Nisakas n2 = new Nisakas("Kalle", 20, "ruskea"); // oletuslaji: ihminen
Nisakas n3 = new Nisakas("apina", "Abu", 2, "tummanruskea");
Nisakas n4 = new Nisakas(); // oletustiedoilla luotu Valle-jääkarhu
Nisakas n5 = new Nisakas("koira", "Turre", "vihreä"); // 0-vuotias Turre-koira
System.out.println(n1);
System.out.println(n2);
System.out.println(n3);
System.out.println(n4);
System.out.println(n5);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment