This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: variables have: name, type, value, memory location declare a variable - specify the type and name of a variable for later use expression - ((Celsius * 9) / 5) + 32 - calculations that produces a result. assignment - "=" - statement that place the result of an expression into a variable. Names Variable names: Must begin with a letter (not a number), No spaces, no symbols other than '_' Additional Java convention: Must begin with a lower-case letter Name has something to do with its use Compound words use capitals for all but first word (i.e. myFirstVariable) Class names (The organizational unit for Java): The same requirements. The only difference is it begins with a capital letter. Questions about above code: What happens if we change the order of the calculation? For example, what if we replace this line: fahrenheit = ((celsius * 9) / 5) + 32; with this line: fahrenheit = celsius * (9 / 5) + 32;...
View Full Document
- Fall '09