From 5f1d7e3ece629169176c9a89e0e13a6e2bdd62ea Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Mon, 10 Aug 2026 22:33:26 +0300
Subject: [PATCH 1/4] replaced th section earlier
---
source/ch6_definingclasses.ptx | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/source/ch6_definingclasses.ptx b/source/ch6_definingclasses.ptx
index f2c8bf7..f495747 100644
--- a/source/ch6_definingclasses.ptx
+++ b/source/ch6_definingclasses.ptx
@@ -629,15 +629,8 @@ public class Fraction {
-
-
-
-
- Inheritance
-
-
- If you ran the program above you probably noticed that the output is not very satisfying. Chances are your output looked something like .
+ If you ran the program above you probably noticed that the output is not very satisfying. Chances are your output looked something like .
@@ -654,8 +647,12 @@ Fraction@6ff3c5b5
In Python you can control how that looks by writing an __str__ method for your class.
If you do not then you will get the default, which looks something like the above.
-
+
+
+
+
+ Inheritance
The Object Class
From bee7af32288e939800248a09b750d66e946ffdb5 Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Mon, 10 Aug 2026 22:37:45 +0300
Subject: [PATCH 2/4] added a listing tags
---
source/ch6_definingclasses.ptx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/source/ch6_definingclasses.ptx b/source/ch6_definingclasses.ptx
index f495747..668aa83 100644
--- a/source/ch6_definingclasses.ptx
+++ b/source/ch6_definingclasses.ptx
@@ -630,7 +630,7 @@ public class Fraction {
- If you ran the program above you probably noticed that the output is not very satisfying. Chances are your output looked something like .
+ If you ran , you probably noticed that the output is not very satisfying. Chances are your output looked something like .
@@ -645,7 +645,7 @@ Fraction@6ff3c5b5
The reason is that we have not yet provided a friendly string representation for our Fraction objects.
Just like in Python, whenever an object is printed by the println method it must be converted to string format.
In Python you can control how that looks by writing an __str__ method for your class.
- If you do not then you will get the default, which looks something like the above.
+ If you do not then you will get the default, which looks something like .
From 7c7441807b9dd122a2a5d5f70882bd7d55cbb527 Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Mon, 10 Aug 2026 22:39:57 +0300
Subject: [PATCH 3/4] added linking to section
---
source/ch6_definingclasses.ptx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/ch6_definingclasses.ptx b/source/ch6_definingclasses.ptx
index 668aa83..67fb411 100644
--- a/source/ch6_definingclasses.ptx
+++ b/source/ch6_definingclasses.ptx
@@ -645,7 +645,7 @@ Fraction@6ff3c5b5
The reason is that we have not yet provided a friendly string representation for our Fraction objects.
Just like in Python, whenever an object is printed by the println method it must be converted to string format.
In Python you can control how that looks by writing an __str__ method for your class.
- If you do not then you will get the default, which looks something like .
+ If you do not then you will get the default, which looks something like . We will see how to provide a friendly string representation for our Fraction class in .
From 26ad182c200fa5c20f9024f72bf0f943749edd85 Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Mon, 10 Aug 2026 23:15:49 +0300
Subject: [PATCH 4/4] fixed erros after merge
---
source/ch6_definingclasses.ptx | 46 +++++++++++++---------------------
1 file changed, 18 insertions(+), 28 deletions(-)
diff --git a/source/ch6_definingclasses.ptx b/source/ch6_definingclasses.ptx
index 32a277b..df7a4af 100644
--- a/source/ch6_definingclasses.ptx
+++ b/source/ch6_definingclasses.ptx
@@ -628,6 +628,24 @@ public class Fraction {
+
+ If you ran , you probably noticed that the output is not very satisfying. Chances are your output looked something like .
+
+
+
+
+
+Fraction@6ff3c5b5
+
+
+
+
+
+ The reason is that we have not yet provided a friendly string representation for our Fraction objects.
+ Just like in Python, whenever an object is printed by the println method it must be converted to string format.
+ In Python you can control how that looks by writing an __str__ method for your class.
+ If you do not then you will get the default, which looks something like . We will see how to provide a friendly string representation for our Fraction class in .
+
@@ -672,34 +690,6 @@ public class Fraction {
-
-
-
-
-
- Inheritance
-
-
-
- If you ran the program above you probably noticed that the output is not very satisfying. Chances are your output looked something like .
-
-
-
-
-
-Fraction@6ff3c5b5
-
-
-
-
-
- The reason is that we have not yet provided a friendly string representation for our Fraction objects.
- Just like in Python, whenever an object is printed by the println method it must be converted to string format.
- In Python you can control how that looks by writing an __str__ method for your class.
- If you do not then you will get the default, which looks something like . We will see how to provide a friendly string representation for our Fraction class in .
-
-
-