Skip to content

Commit f7e974b

Browse files
authored
Merge pull request #18 from kabutz/master
Small typos
2 parents 620b9e0 + 6e12795 commit f7e974b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

chapter00-genesis.jsh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// ## Types
1010
// A primitive type is stored as value while an object is stored as
1111
// a reference (the address of the object in memory).
12-
// In Java, `var` create a new variable
12+
// In Java, `var` creates a new variable
1313
var maxIntensity = 1.0; // it's a value
1414
var colorName = "black"; // it's a reference to String somewhere in memory
1515

@@ -35,8 +35,8 @@ System.out.println("the value of colorName is " + colorName);
3535
record Light(String color, double intensity) {}
3636

3737
// ### Object creation with `new`
38-
// To create an object in memory, we use the operator `new` followed by the value of each record components
39-
// the following instruction create a Light with "blue" as color and 1.0 as intensity.
38+
// To create an object in memory, we use the operator `new` followed by the value of each record component.
39+
// The following instruction creates a Light with "blue" as color and 1.0 as intensity.
4040
var blueLight = new Light("blue", 1.0);
4141
System.out.println(blueLight);
4242

@@ -58,7 +58,7 @@ System.out.println(blueLight.toString());
5858
System.out.println(blueLight);
5959

6060
// ### equals()
61-
// In Java, you can ask if two objects are equals, using the method equals(Object).
61+
// In Java, you can ask if two objects are equal, using the method equals(Object).
6262
// The return value is a boolean (a primitive type that is either true or false).
6363
var redLight = new Light("red", 0.5);
6464
var redLight2 = new Light("red", 0.5);
@@ -83,4 +83,4 @@ System.out.println(greenLight2.hashCode());
8383
// call on an object using the operator `.`.
8484
// A Record defines methods to access the value of a component, and also
8585
// `toString()` to get the textual representation of an object and
86-
// `equals()` and `hashCode()` to test if two objects are equals.
86+
// `equals()` and `hashCode()` to test if two objects are equal.

0 commit comments

Comments
 (0)