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

Slides:



Advertisements
Similar presentations
Knuth-Morris-Pratt algoritmus (KMP) Farkas Attila FAANABI.ELTE.
Advertisements

For(int i = 1; i
STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
Execute Blocks of Code Multiple Times Telerik Software Academy C# Fundamentals – Part 1.
Chapter 3 DATA: TYPES, CLASSES, AND OBJECTS. Chapter 3 Data Abstraction Abstract data types allow you to work with data without concern for how the data.
Chapter 10 Review. Write a method that returns true is s1 and s2 end with the same character; otherwise return false. Sample Answer: public boolean lastChar(String.
Lecture # 21 Chapter 6 Uptill 6.4. Type System A type system is a collection of rules for assigning type expressions to the various parts of the program.
Constructors & An Introduction to Methods. Defining Constructor – Car Example Public class car { String Model; double speed; String colour; { Public Car.
int getThird(int *arr){ return arr[3]; } In all these examples “n” is the size of the input e.g. length of arr O(1) And what two things are wrong with.
If Statements & Relational Operators Programming.
Loops in Scheme, II c. Kathi Fisler, 2001 (early slides assume map/filter)
Introduction to Programming with Java, for Beginners Arrays of Objects.
CS1110: Computer Science I Chapter 5 Arrays. One-dimensional Arrays int [] data = new int [4]; data[0] = 1; data[1] = 3; data[2] = 5; data[3] = 7; Arrays.
March 2007ACS Ron McFadyen1 Façade simplifies access to a related set of objects by providing one object that all objects outside the set use to.
Cook-Levin Theorem Circuit Satisfiability –A “first” NP-complete problem Reduction overview Example reduction.
November Ron McFadyen1 Façade simplifies access to a related set of objects by providing one object that all objects outside the set use to.
AAAARCH Research Group A grammar for Policies in a generic AAA Environment.
Sea Creatures: Write your names here Write your class here Write your school here Write the name of your sea animal here.
Copyright 2008 by Pearson Education Building Java Programs Chapter 9 Lecture 9-x: Critters reading: HW9 Spec.
Crossword Puzzle Solver Michael Keefe. Solver structure.
What can zoos do? Chapter 9. Good Zoos Animals have land and trees They are fed in a natural way – must look for food, are not fed by hand.
CSci 125 Lecture 10 Martin van Bommel. Simple Statements Expression followed by semicolon Assignments total = n1 + n2; Function calls printf(”Hello.\n”);
What’s the Goal of Design? Answer: Flexibility As you arrive… If you have not done so already, please set up your computer to snarf code using the Ambient.
Inheritance, Abstract & Interface Pepper With help from and
David Streader & Peter Andreae Computer Science Victoria University of Wellington Copyright: David Streader, Victoria University of Wellington Objects.
Characters and Strings. Characters  New primitive char  char letter; letter = ‘a’; char letter2 = ‘C’;  Because computers can only represent numbers,
C++ Basics. Compilation What does compilation do? g++ hello.cpp g++ -o hello.cpp hello.
Some odds and ends about Classes and Objects. 6-2 Object-Oriented Programming Object Data (Fields) Methods That Operate on the Data.
CSE 143 Lecture 20 Abstract classes. 2 Circle public class Circle { private double radius; public Circle(double radius) { this.radius = radius; } public.
String Matching By Joshua Yudaken. Terms Haystack A string in which to search Needle The string being searched for  find the needle in the haystack.
Animals. I live ______ Farm Wild Water Zoo Animal Picture Pairs.
Print Me Who’s Data? First Executed Name Me My Mistake Q $100 Q $200 Q $300 Q $400 Q $500 Q $100 Q $200 Q $300 Q $400 Q $500 Final Jeopardy.
Chapter One Lesson Three DATA TYPES ©
CS2102: Lecture on Abstract Classes and Inheritance Kathi Fisler.
A: A: double “4” A: “34” 4.
CSED101 INTRODUCTION TO COMPUTING FUNCTION ( 함수 ) 유환조 Hwanjo Yu.
H OMEWORK 2 Q UIZ E XPLANATIONS, N OTES A BOUT L INKED L ISTS I NSIDE O BJECTS, AND A B IT ABOUT S TREAMS.
Under the Hood: A Map This slidedeck shows the various kinds of information that Java tracks under the hood as you create classes and objects and evaluate.
Chapter 4: Types. Why Have Types? Detect simple kinds of errors: int square(int x) { return x*x; }... int bogus = square(“hello”); String bogus2 = square(3);
Java String Methods - Codehs
Mapping Methods With Arguments
Section 2.6 Linked List StringLog ADT Implementation
Two Dimensional Arrays
Agenda Warmup Finish 2.4 Assignments
Generic array list and casting C&K s7.7
CS2102: Lecture on Abstract Classes and Inheritance
More on Classes & Arrays
Review Operation Bingo
نوع داده هاي انتزاعي Abstract Data Types
Chapter 4: Types.
Bools and simple if statements
Intro to UML Edited from presentation found at:
סדר דין פלילי – חקיקה ומהות ההליך הפלילי
searching Concept: Linear search Binary search
(early slides assume map/filter)
Summary Two basic concepts: variables and assignments Basic types:

Web Service.
Boolean Variables & Values
Nate Brunelle Today: Conditional Decision Statements
ECS15 boolean.
Revision I This presentation gives you some hints for solution of selected problems.
1,000, , , Year Old Topic 1 10 Year Old Topic 2 175, ,000 9 Year Old Topic 3 9 Year Old Topic 4 50,000 8 Year Old Topic 5 8 Year.
(Dreaded) Quiz 2 Next Monday.
You must show all steps of your working out.
Question 1.
Data Types and Maths Programming Guides.
In your notebook… Purpose: What types of data can we store in C
Michele Weigle - COMP 14 - Spr 04
Conditionals.
Presentation transcript:

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(); ...   }

(* 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; }