Last active
March 14, 2019 11:21
-
-
Save areee/2a64e23d43e14de5d344ff643d6c3b95 to your computer and use it in GitHub Desktop.
Nisäkäs-luokan pääohjelma
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 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