next up previous
Next: 1.3.1 Java Expressions Up: 1. From Scheme to Previous: 1.2 What is an

1.3 Java Notation and Syntax

Let us focus for a moment on the major differences in notation between Scheme and Java.

In Scheme, programs are constructed from expressions, written in parenthesized prefix form. Three simple examples of Scheme expressions are:

    (+ (* x x) (* y y))
    (and (> x 0) (= y z))
    (merge list1 list2)
In contrast, Java programs are constructed from statements--program phrases that do not have values--similar to Scheme expressions like (set! ...) that return <#void>. But many Java statements contain expressions, so let us look briefly at Java expressions.



 

Robert Cartwright, Spring 1999