/*01*/ public class LintuLenssu { /*02*/ private static int voittoja; /*03*/ public static String virus = "H5N1"; /*04*/ /*05*/ public static class Lintu { /*06*/ private boolean myrkytetty = false; /*07*/ public static boolean sairas; /*08*/ /*09*/ public Lintu(boolean tosi) { /*10*/ if (!tosi) { /*11*/ StringBuffer sb = new StringBuffer("Virus tulee Suomeen!"); /*12*/ myrkytetty = !myrkytetty; /*13*/ if (sb.length() > virus.length()) sb.append(" Syökää kanaa!"); /*14*/ media(sb.toString()); /*15*/ } /*16*/ if (tosi) sairastu(true); /*17*/ myrkytetty = !tosi; /*18*/ } /*19*/ /*20*/ public void aantele() { /*21*/ if (myrkytetty) System.out.println("R.I.P."); /*22*/ if (!this.sairas && !myrkytetty) System.out.println("Olen terve. KVAAAK!"); /*23*/ if (!!sairas) System.out.println("niisk!"); /*24*/ } /*25*/ /*26*/ public void sairastu(boolean kipia) { /*27*/ this.sairas = true; /*28*/ voittoja += 1; /*29*/ } /*30*/ } /*31*/ /*32*/ public static void media(String propaganda) { /*33*/ if (propaganda.length() > virus.length()) /*34*/ System.out.println(propaganda); /*35*/ } /*36*/ /*37*/ public static void media() { /*38*/ System.out.println("Paniikki! " + virus + " on voittanut " + voittoja + " kertaa!"); /*39*/ } /*40*/ /*41*/ public static void main(String[] args) { /*42*/ Lintu tirppa = new Lintu(false); /*43*/ Lintu kotkansorsa = tirppa; /*44*/ kotkansorsa.aantele(); /*45*/ media(); /*46*/ tirppa = new Lintu(true); /*47*/ tirppa.aantele(); /*48*/ media(); /*49*/ } /*50*/ }