Skip to content

Commit ea0bae9

Browse files
committed
editing
1 parent f2a6e76 commit ea0bae9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Diff for: chapter02-methods.jsh

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ record Rectangle(int width, int height) {
9393
var rectangle2 = new Rectangle(4, 3);
9494
System.out.println(rectangle2.diagonal());
9595

96-
// it can also be written like this
96+
// it can also be written using a static method `pow2()` to share some code
9797
record Rectangle(int width, int height) {
9898
double diagonal() {
9999
return Math.sqrt(pow2(width) + pow2(height));

Diff for: guide/chapter02-methods.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ var rectangle2 = new Rectangle(4, 3);
106106
System.out.println(rectangle2.diagonal());
107107
```
108108

109-
it can also be written like this
109+
it can also be written using a static method `pow2()` to share some code
110110
```java
111111
record Rectangle(int width, int height) {
112112
double diagonal() {

Diff for: jupyter/chapter02-methods.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
{
139139
"cell_type": "markdown",
140140
"metadata": {},
141-
"source": ["it can also be written like this\n"]
141+
"source": ["it can also be written using a static method `pow2()` to share some code\n"]
142142
}
143143
,
144144
{

0 commit comments

Comments
 (0)