Lecture12 - Java Programming, 3e Concepts and Techniques...

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

View Full Document Right Arrow Icon
Java Programming, 3e Concepts and Techniques Chapter 3 Manipulating Data Using Methods (IV) ICTN 2730 Lecture 12 02/08/2008
Background image of page 1

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

View Full DocumentRight Arrow Icon
Chapter 3: Manipulating Data Using Methods 2 Assignments Read Chapter 3 and “Writing Methods” in Chapter 4 before doing Homework 4. Type, compile and run BodyMassSwing.java and BodyMassApplet.java in TextPad (No need to submit the code.) Homework 4 is due next Wednesday. Homework 4 contains a bonus section. Do not miss the opportunity of improving your grade. Please start early and let the instructor know if there is any problem. Be specific when asking questions.
Background image of page 2
Chapter 3: Manipulating Data Using Methods 3 Storing Data Java is a strongly typed language Variables must be declared with a data type Variable locations can hold only that data type e.g. an integer variable cannot store a String value Java has two categories of data types Primitive data types hold single data items Integers, characters, floating point, and booleans are primitive types Reference data types hold a value that refers to the location of the data All Objects and arrays are reference types, e.g. currentDate
Background image of page 3

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

View Full DocumentRight Arrow Icon
Chapter 3: Manipulating Data Using Methods 4 Numeric Expressions Numeric expressions evaluate to a number e.g. response= 18/3-2+4*2 ; e.g. tax = ( income-deduction)*taxRate ; Only numeric primitive data types may be used in a numeric expression A value and variable must be separated by an arithmetic operator Unless parentheses supersede, an expression is evaluated left to right with the certain rules of precedence.
Background image of page 4
Chapter 3: Manipulating Data Using Methods 5 Conditional Expressions Conditional expression evaluate to either true or false – a boolean value Comparison operators, values, variables, methods, and Strings may be used in a conditional expression Two operands must be separated by a comparison
Background image of page 5

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

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 22

Lecture12 - Java Programming, 3e Concepts and Techniques...

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

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