{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lecture5

lecture5 - Web Technology for IE 25 September 2003 ISE 582...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Web Technology for IE 25 September 2003 http://www-classes.usc.edu/engr/ise/582 1 ISE 582: Information Technology for Industrial Engineering Instructor: Elaine Chew University of Southern California Department of Industrial and Systems Engineering Lecture 5 Fourth cup of JAVA: Problem Solving 25 September 2003 Web Technology for IE 2 JAVA Cup 4: Problem Solving • Boolean operators and methods • Conditional statements • Combining Boolean expressions • Iteration Statements • Recursion • Multi-way Conditions 25 September 2003 Web Technology for IE 3 Booleans == != > < >= <= ! instanceof equals EXAMPLE: public class Demonstrate { public static void main (String argv[]) { System.out.println(28==2); Gringotts js = new Gringotts(); MuggleBank js2 = new MuggleBank(); System.out.println(js instanceof Gringotts); System.out.println(js instanceof Account); System.out.println(js2.equals(js)); } } Binary Predicates
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Web Technology for IE 25 September 2003 http://www-classes.usc.edu/engr/ise/582 2 25 September 2003 Web Technology for IE 4 Predicates Example 2 public class Demonstrate1 { public static void main (String argv[]) { TTM ttm = new TTM(); Gringotts hp = new Gringotts(); System.out.println(ttm instanceof Account); System.out.println(ttm instanceof Gringotts); System.out.println(ttm instanceof TTM); System.out.println(hp instanceof Account); System.out.println(hp instanceof Gringotts); System.out.println(hp instanceof TTM); } } NEW 25 September 2003 Web Technology for IE 5 Predicates Example 3 public class Demonstrate { public static void main (String argv[]) { Gringotts hp = new Gringotts(3,4,5); Gringotts rw = new Gringotts(3,4,5); Gringotts hg = new Gringotts(4,5,6);
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 7

lecture5 - Web Technology for IE 25 September 2003 ISE 582...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online