Skip to content

Commit 471de64

Browse files
committed
Ran the build.java file to update the md and ipynb files. Also, changed "32 bits" to the more common "32-bit" etc.
1 parent f7e974b commit 471de64

9 files changed

+40
-40
lines changed

chapter00-genesis.jsh

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ System.out.println("the value of colorName is " + colorName);
3131

3232
// ## A record is a user defined type
3333
// here Light is defined as containing two components: a color (typed as a String) and
34-
// an intensity (typed as a 64 bits floating number double).
34+
// an intensity (typed as a 64-bit floating number double).
3535
record Light(String color, double intensity) {}
3636

3737
// ### Object creation with `new`

chapter01-basic_types.jsh

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// # Basic Types
66
// Java has two kinds of type,
77
// - primitive types that are directly mapped to CPU basic types
8-
// - reference types that address of the object in memory
8+
// - reference types that have the address of the object in memory
99

1010
// ## Primitive types
1111
// primitive types, written in lower case, have no method
@@ -17,25 +17,25 @@ var anotherResult = false;
1717
// ### char (character)
1818
var firstLetter = 'j';
1919

20-
// ### int (signed 32 bits integer)
20+
// ### int (signed 32-bit integer)
2121
var numberOfLegs = 2;
2222

23-
// ### double (64 bits floating point)
23+
// ### double (64-bit floating point)
2424
var cost = 3.78;
2525

2626
// ### long and float
2727
// some more exotic types that requires a suffix (`L` or `f`)
28-
// long (64 bits integers) and float (32 bits floating point numbers)
28+
// long (64-bit integers) and float (32-bit floating point numbers)
2929
var longValue = 123L;
3030
var floatValue = 123.5f;
3131

3232
// ### byte and short
33-
// you also have byte (a signed 8 bits integer) and short (a signed 16 bits short integer)
34-
// that are only useful to take less memory when defining an object
33+
// you also have byte (a signed 8-bit integer) and short (a signed 16-bit short integer)
34+
// that are only useful to use less memory when defining an object
3535
record CompactHeader(byte tag, short version) {}
3636

37-
// when used in variables, they are promoted to 32 bits integer
38-
// in the following code result is a 32 bits integer (so an int)
37+
// when used in variables, they are promoted to a 32-bit integer.
38+
// In the following code, `result` is a 32-bit integer (so an int)
3939
short value = 12;
4040
var result = value + value;
4141

chapter04-numbers.jsh

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// # Numbers
66
// This chapter in not specific to Java but more on how integers and floating point numbers
7-
// works on CPUs like Intel 64 bits or ARM 64 bits.
7+
// work on CPUs like Intel 64-bit or ARM 64-bit.
88

99

1010
// ## Integers
@@ -65,7 +65,7 @@ System.out.println(0.1 + 0.2);
6565
// so you may think the value is fully represented that but that's just an illusion
6666
System.out.println(1.0 / 3.0);
6767

68-
// On way to see the trick is to ask a float, a 32 bits, to be printed as a double, 64 bits.
68+
// On way to see the trick is to ask a float (32-bit), to be printed as a double (64-bit).
6969
System.out.println(1.0f / 3.0f);
7070
System.out.println(Float.toString(1.0f / 3.0f));
7171
System.out.println(Double.toString(1.0f / 3.0f)); // damn i'm unmasked

guide/chapter00-genesis.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ objects like String that have a name that starts with an uppercase letter.
55
## Types
66
A primitive type is stored as value while an object is stored as
77
a reference (the address of the object in memory).
8-
In Java, `var` create a new variable
8+
In Java, `var` creates a new variable
99
```java
1010
var maxIntensity = 1.0; // it's a value
1111
var colorName = "black"; // it's a reference to String somewhere in memory
@@ -37,14 +37,14 @@ System.out.println("the value of colorName is " + colorName);
3737

3838
## A record is a user defined type
3939
here Light is defined as containing two components: a color (typed as a String) and
40-
an intensity (typed as a 64 bits floating number double).
40+
an intensity (typed as a 64-bit floating number double).
4141
```java
4242
record Light(String color, double intensity) {}
4343
```
4444

4545
### Object creation with `new`
46-
To create an object in memory, we use the operator `new` followed by the value of each record components
47-
the following instruction create a Light with "blue" as color and 1.0 as intensity.
46+
To create an object in memory, we use the operator `new` followed by the value of each record component.
47+
The following instruction creates a Light with "blue" as color and 1.0 as intensity.
4848
```java
4949
var blueLight = new Light("blue", 1.0);
5050
System.out.println(blueLight);
@@ -72,7 +72,7 @@ System.out.println(blueLight);
7272
```
7373

7474
### equals()
75-
In Java, you can ask if two objects are equals, using the method equals(Object).
75+
In Java, you can ask if two objects are equal, using the method equals(Object).
7676
The return value is a boolean (a primitive type that is either true or false).
7777
```java
7878
var redLight = new Light("red", 0.5);
@@ -101,4 +101,4 @@ To interact with an object, we are using methods that are functions that you
101101
call on an object using the operator `.`.
102102
A Record defines methods to access the value of a component, and also
103103
`toString()` to get the textual representation of an object and
104-
`equals()` and `hashCode()` to test if two objects are equals.
104+
`equals()` and `hashCode()` to test if two objects are equal.

guide/chapter01-basic_types.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Basic Types
22
Java has two kinds of type,
33
- primitive types that are directly mapped to CPU basic types
4-
- reference types that address of the object in memory
4+
- reference types that have the address of the object in memory
55

66
## Primitive types
77
primitive types, written in lower case, have no method
@@ -17,33 +17,33 @@ var anotherResult = false;
1717
var firstLetter = 'j';
1818
```
1919

20-
### int (signed 32 bits integer)
20+
### int (signed 32-bit integer)
2121
```java
2222
var numberOfLegs = 2;
2323
```
2424

25-
### double (64 bits floating point)
25+
### double (64-bit floating point)
2626
```java
2727
var cost = 3.78;
2828
```
2929

3030
### long and float
3131
some more exotic types that requires a suffix (`L` or `f`)
32-
long (64 bits integers) and float (32 bits floating point numbers)
32+
long (64-bit integers) and float (32-bit floating point numbers)
3333
```java
3434
var longValue = 123L;
3535
var floatValue = 123.5f;
3636
```
3737

3838
### byte and short
39-
you also have byte (a signed 8 bits integer) and short (a signed 16 bits short integer)
40-
that are only useful to take less memory when defining an object
39+
you also have byte (a signed 8-bit integer) and short (a signed 16-bit short integer)
40+
that are only useful to use less memory when defining an object
4141
```java
4242
record CompactHeader(byte tag, short version) {}
4343
```
4444

45-
when used in variables, they are promoted to 32 bits integer
46-
in the following code result is a 32 bits integer (so an int)
45+
when used in variables, they are promoted to a 32-bit integer.
46+
In the following code, `result` is a 32-bit integer (so an int)
4747
```java
4848
short value = 12;
4949
var result = value + value;

guide/chapter04-numbers.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Numbers
22
This chapter in not specific to Java but more on how integers and floating point numbers
3-
works on CPUs like Intel 64 bits or ARM 64 bits.
3+
work on CPUs like Intel 64-bit or ARM 64-bit.
44

55

66
## Integers
@@ -81,7 +81,7 @@ so you may think the value is fully represented that but that's just an illusion
8181
System.out.println(1.0 / 3.0);
8282
```
8383

84-
On way to see the trick is to ask a float, a 32 bits, to be printed as a double, 64 bits.
84+
On way to see the trick is to ask a float (32-bit), to be printed as a double (64-bit).
8585
```java
8686
System.out.println(1.0f / 3.0f);
8787
System.out.println(Float.toString(1.0f / 3.0f));

jupyter/chapter00-genesis.ipynb

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
"cell_type": "markdown",
1010
"metadata": {},
11-
"source": ["## Types\n", "A primitive type is stored as value while an object is stored as\n", "a reference (the address of the object in memory).\n", "In Java, `var` create a new variable\n"]
11+
"source": ["## Types\n", "A primitive type is stored as value while an object is stored as\n", "a reference (the address of the object in memory).\n", "In Java, `var` creates a new variable\n"]
1212
}
1313
,
1414
{
@@ -78,7 +78,7 @@
7878
{
7979
"cell_type": "markdown",
8080
"metadata": {},
81-
"source": ["## A record is a user defined type\n", "here Light is defined as containing two components: a color (typed as a String) and\n", "an intensity (typed as a 64 bits floating number double).\n"]
81+
"source": ["## A record is a user defined type\n", "here Light is defined as containing two components: a color (typed as a String) and\n", "an intensity (typed as a 64-bit floating number double).\n"]
8282
}
8383
,
8484
{
@@ -92,7 +92,7 @@
9292
{
9393
"cell_type": "markdown",
9494
"metadata": {},
95-
"source": ["### Object creation with `new`\n", "To create an object in memory, we use the operator `new` followed by the value of each record components\n", "the following instruction create a Light with \"blue\" as color and 1.0 as intensity.\n"]
95+
"source": ["### Object creation with `new`\n", "To create an object in memory, we use the operator `new` followed by the value of each record component.\n", "The following instruction creates a Light with \"blue\" as color and 1.0 as intensity.\n"]
9696
}
9797
,
9898
{
@@ -140,7 +140,7 @@
140140
{
141141
"cell_type": "markdown",
142142
"metadata": {},
143-
"source": ["### equals()\n", "In Java, you can ask if two objects are equals, using the method equals(Object).\n", "The return value is a boolean (a primitive type that is either true or false).\n"]
143+
"source": ["### equals()\n", "In Java, you can ask if two objects are equal, using the method equals(Object).\n", "The return value is a boolean (a primitive type that is either true or false).\n"]
144144
}
145145
,
146146
{
@@ -168,7 +168,7 @@
168168
{
169169
"cell_type": "markdown",
170170
"metadata": {},
171-
"source": ["## Summary\n", "A `record` has components that are the parameters used to create an object\n", "To create an object we use the operator `new` followed by the arguments of the\n", "record components in the same order.\n", "To interact with an object, we are using methods that are functions that you\n", "call on an object using the operator `.`.\n", "A Record defines methods to access the value of a component, and also\n", "`toString()` to get the textual representation of an object and\n", "`equals()` and `hashCode()` to test if two objects are equals.\n"]
171+
"source": ["## Summary\n", "A `record` has components that are the parameters used to create an object\n", "To create an object we use the operator `new` followed by the arguments of the\n", "record components in the same order.\n", "To interact with an object, we are using methods that are functions that you\n", "call on an object using the operator `.`.\n", "A Record defines methods to access the value of a component, and also\n", "`toString()` to get the textual representation of an object and\n", "`equals()` and `hashCode()` to test if two objects are equal.\n"]
172172
}
173173
],
174174
"metadata": {

jupyter/chapter01-basic_types.ipynb

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [{
33
"cell_type": "markdown",
44
"metadata": {},
5-
"source": ["# Basic Types\n", "Java has two kinds of type,\n", "- primitive types that are directly mapped to CPU basic types\n", "- reference types that address of the object in memory\n"]
5+
"source": ["# Basic Types\n", "Java has two kinds of type,\n", "- primitive types that are directly mapped to CPU basic types\n", "- reference types that have the address of the object in memory\n"]
66
}
77
,
88
{
@@ -42,7 +42,7 @@
4242
{
4343
"cell_type": "markdown",
4444
"metadata": {},
45-
"source": ["### int (signed 32 bits integer)\n"]
45+
"source": ["### int (signed 32-bit integer)\n"]
4646
}
4747
,
4848
{
@@ -56,7 +56,7 @@
5656
{
5757
"cell_type": "markdown",
5858
"metadata": {},
59-
"source": ["### double (64 bits floating point)\n"]
59+
"source": ["### double (64-bit floating point)\n"]
6060
}
6161
,
6262
{
@@ -70,7 +70,7 @@
7070
{
7171
"cell_type": "markdown",
7272
"metadata": {},
73-
"source": ["### long and float\n", "some more exotic types that requires a suffix (`L` or `f`)\n", "long (64 bits integers) and float (32 bits floating point numbers)\n"]
73+
"source": ["### long and float\n", "some more exotic types that requires a suffix (`L` or `f`)\n", "long (64-bit integers) and float (32-bit floating point numbers)\n"]
7474
}
7575
,
7676
{
@@ -84,7 +84,7 @@
8484
{
8585
"cell_type": "markdown",
8686
"metadata": {},
87-
"source": ["### byte and short\n", "you also have byte (a signed 8 bits integer) and short (a signed 16 bits short integer)\n", "that are only useful to take less memory when defining an object\n"]
87+
"source": ["### byte and short\n", "you also have byte (a signed 8-bit integer) and short (a signed 16-bit short integer)\n", "that are only useful to use less memory when defining an object\n"]
8888
}
8989
,
9090
{
@@ -98,7 +98,7 @@
9898
{
9999
"cell_type": "markdown",
100100
"metadata": {},
101-
"source": ["when used in variables, they are promoted to 32 bits integer\n", "in the following code result is a 32 bits integer (so an int)\n"]
101+
"source": ["when used in variables, they are promoted to a 32-bit integer.\n", "In the following code, `result` is a 32-bit integer (so an int)\n"]
102102
}
103103
,
104104
{

jupyter/chapter04-numbers.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [{
33
"cell_type": "markdown",
44
"metadata": {},
5-
"source": ["# Numbers\n", "This chapter in not specific to Java but more on how integers and floating point numbers\n", "works on CPUs like Intel 64 bits or ARM 64 bits.\n"]
5+
"source": ["# Numbers\n", "This chapter in not specific to Java but more on how integers and floating point numbers\n", "work on CPUs like Intel 64-bit or ARM 64-bit.\n"]
66
}
77
,
88
{
@@ -160,7 +160,7 @@
160160
{
161161
"cell_type": "markdown",
162162
"metadata": {},
163-
"source": ["On way to see the trick is to ask a float, a 32 bits, to be printed as a double, 64 bits.\n"]
163+
"source": ["On way to see the trick is to ask a float (32-bit), to be printed as a double (64-bit).\n"]
164164
}
165165
,
166166
{

0 commit comments

Comments
 (0)