RU beehive logo ITEC Department logo
ITEC 120
2007spring
ibarland,
jpittges

homeinfoexamslectureslabshws
RecipeLawsliessyntaxjava.lang docsjava.util docs

syntax
Java Syntax
week 4

Our Mantras1

def'n of “mantra”

Java Syntax

Week 4's syntax includes all the syntax everything we covered in week 3, plus long, and casts. We also loosen our requirements on method bodies (they can contain any statements), and the fact that variable-initializion might happen inside an if-else statement.

Expressions

Expressions are things which you can type into BlueJ's Code Pad, and they evaluate to a value, like “7+4” and 7 + Math.sqrt( Math.abs(-16) ).

Declarations

Remember that the only time you mention a type in Java is when you are making a declaration: either declaring a parameter, or a local variable, or a function-signature.2

Statements

Statements actually do something: return a value, or assign to (initialize) a local-variable.

Misc (lists)

Names

How to read Backus-Naur Form (BNF)

caveats

See also: Lies


1

     

2Oh, when you do a cast (to convert one numeric type to another), you mention a type there too.      

homeinfoexamslectureslabshws
RecipeLawsliessyntaxjava.lang docsjava.util docs


©2007, Ian Barland, Radford University
Last modified 2007.Aug.27 (Mon)
Please mail any suggestions
(incl. typos, broken links)
to iba�rlandrad�ford.edu
Powered by PLT Scheme