Presentation is loading. Please wait.

Presentation is loading. Please wait.

public class Dillo {     public int length;     public boolean isDead;         

Similar presentations


Presentation on theme: "public class Dillo {     public int length;     public boolean isDead;         "— Presentation transcript:

1 public class Dillo {     public int length;     public boolean isDead;              Dillo(int l, boolean isD) {          this.length = l;          this.isDead = isD;      } public boolean canShelter() { return this.length > 60 && this.isDead; }  } public class Whatever { ... Dillo babyDillo = new Dillo(8, false); boolean answer = babyDillo.canShelter(); ...   }

2 (* animals in OCaml *) type animal =   | Dillo of (int * bool)  | Boa of (string * int * string) public class Boa { public string name;     public int length;     public string eats;              public Boa (String name, int length, String eats) {     this.name = name ;     this.length = length ;     this.eats = eats ;   }  } public class Dillo {     public int length;     public boolean isDead;              Dillo(int l, boolean isD) {          this.length = l;          this.isDead = isD;      } public boolean canShelter() { return this.length > 60 && this.isDead; }  } public class Zoo { public _______ animal1;     public _______ animal2; }


Download ppt "public class Dillo {     public int length;     public boolean isDead;         "

Similar presentations


Ads by Google