summaryrefslogtreecommitdiff
path: root/doc/reference/ScalaByExample.tex
diff options
context:
space:
mode:
Diffstat (limited to 'doc/reference/ScalaByExample.tex')
-rw-r--r--doc/reference/ScalaByExample.tex4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/reference/ScalaByExample.tex b/doc/reference/ScalaByExample.tex
index bea8c37665..7849be4882 100644
--- a/doc/reference/ScalaByExample.tex
+++ b/doc/reference/ScalaByExample.tex
@@ -1397,9 +1397,9 @@ As an example of how rational numbers can be used, here's a program
that prints the sum of all numbers $1/i$ where $i$ ranges from 1 to 10.
\begin{lstlisting}
var i = 1;
-var x = Rational(0, 1);
+var x = new Rational(0, 1);
while (i <= 10) {
- x = x + Rational(1,i);
+ x = x + new Rational(1,i);
i = i + 1;
}
System.out.println(x.numer + "/" + x.denom);