From 11fd702f142e0dae87576fb12badc25f2808c97a Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Mon, 10 Aug 2026 16:34:38 +0300
Subject: [PATCH 01/27] added exercises in 6.3
---
source/ch6_definingclasses.ptx | 74 +++++++++++++++++++++++++++++++++-
1 file changed, 73 insertions(+), 1 deletion(-)
diff --git a/source/ch6_definingclasses.ptx b/source/ch6_definingclasses.ptx
index f2c8bf7..e7a99da 100644
--- a/source/ch6_definingclasses.ptx
+++ b/source/ch6_definingclasses.ptx
@@ -628,8 +628,80 @@ public class Fraction {
-
+
+
+
+ Rearrange the blocks to create a Fraction class that uses constructor overloading and chaining to perform subtraction. The subtract method should accept another Fraction object, and an overloaded constructor should easily convert an int into a Fraction so both types can be subtracted seamlessly.
+
+
+
+
+ public class Fraction {
+ private int num, den;
+ public Fraction(int num, int den) {
+ this.num = num;
+ this.den = den;
+ }
+
+
+ public class Fraction {
+ private int num, den;
+ public void Fraction(int num, int den) {
+ this.num = num;
+ this.den = den;
+ }
+
+
+
+
+
+ public Fraction(int wholeNumber) {
+ this(wholeNumber, 1);
+ }
+
+
+ public Fraction(int wholeNumber) {
+ Fraction(wholeNumber, 1);
+ }
+
+
+
+
+
+ public Fraction subtract(Fraction other) {
+ int newNum = this.num * other.den - other.num * this.den;
+ int newDen = this.den * other.den;
+ return new Fraction(newNum, newDen);
+ }
+
+
+ public Fraction subtract(Fraction other) {
+ int newNum = this.num * other.den - other.num * this.den;
+ int newDen = this.den * other.den;
+ return new Fraction();
+ }
+
+
+
+
+
+ public Fraction subtract(int number) {
+ return this.subtract(new Fraction(number));
+ }
+
+
+ public Fraction subtract(int number) {
+ return this.subtract(Fraction(number));
+ }
+
+
+
+
+ }
+
+
+
From 2b73d6b70cf368fd3249fd3f95cb460ff6cf315a Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Mon, 10 Aug 2026 18:04:31 +0300
Subject: [PATCH 02/27] fixed placement
---
source/ch6_definingclasses.ptx | 142 ++++++++++++++++-----------------
1 file changed, 70 insertions(+), 72 deletions(-)
diff --git a/source/ch6_definingclasses.ptx b/source/ch6_definingclasses.ptx
index e7a99da..941da7e 100644
--- a/source/ch6_definingclasses.ptx
+++ b/source/ch6_definingclasses.ptx
@@ -423,6 +423,76 @@ public Fraction(Integer num, Integer den) {
+
+
+
+ Rearrange the blocks to create a Cat class with instance variables name and age. Implement a default constructor that initializes name to "Unknown" and age to 0. Finally, instantiate a Cat object in main and print its values.
+
+
+
+
+
+ public class Cat {
+ private String name;
+ private int age;
+
+
+ public class Cat {
+ private String name = "Unknown";
+ private int age = 0;
+
+
+
+
+
+ public Cat() {
+ this.name = "Unknown";
+ this.age = 0;
+ }
+
+
+ public void Cat() {
+ this.name = "Unknown";
+ this.age = 0;
+ }
+
+
+
+
+
+ public static void main(String[] args) {
+
+
+ public void main(String[] args) {
+
+
+
+
+
+ Cat myCat = new Cat();
+
+
+ Cat myCat = Cat();
+
+
+
+
+
+ System.out.println("Name: " + myCat.name);
+ System.out.println("Age: " + myCat.age);
+ }
+ }
+
+
+ System.out.println("Name: " + Cat.name);
+ System.out.println("Age: " + Cat.age);
+ }
+ }
+
+
+
+
+
@@ -629,79 +699,7 @@ public class Fraction {
-
-
-
- Rearrange the blocks to create a Fraction class that uses constructor overloading and chaining to perform subtraction. The subtract method should accept another Fraction object, and an overloaded constructor should easily convert an int into a Fraction so both types can be subtracted seamlessly.
-
-
-
-
- public class Fraction {
- private int num, den;
- public Fraction(int num, int den) {
- this.num = num;
- this.den = den;
- }
-
-
- public class Fraction {
- private int num, den;
- public void Fraction(int num, int den) {
- this.num = num;
- this.den = den;
- }
-
-
-
-
-
- public Fraction(int wholeNumber) {
- this(wholeNumber, 1);
- }
-
-
- public Fraction(int wholeNumber) {
- Fraction(wholeNumber, 1);
- }
-
-
-
-
- public Fraction subtract(Fraction other) {
- int newNum = this.num * other.den - other.num * this.den;
- int newDen = this.den * other.den;
- return new Fraction(newNum, newDen);
- }
-
-
- public Fraction subtract(Fraction other) {
- int newNum = this.num * other.den - other.num * this.den;
- int newDen = this.den * other.den;
- return new Fraction();
- }
-
-
-
-
-
- public Fraction subtract(int number) {
- return this.subtract(new Fraction(number));
- }
-
-
- public Fraction subtract(int number) {
- return this.subtract(Fraction(number));
- }
-
-
-
-
- }
-
-
-
From 5f5742ad7bd8dba4d774348545d91f3f68f708d5 Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Mon, 10 Aug 2026 21:21:04 +0300
Subject: [PATCH 03/27] added a smaller question
---
source/ch6_definingclasses.ptx | 58 ++++++++++++++++------------------
1 file changed, 28 insertions(+), 30 deletions(-)
diff --git a/source/ch6_definingclasses.ptx b/source/ch6_definingclasses.ptx
index 941da7e..916820a 100644
--- a/source/ch6_definingclasses.ptx
+++ b/source/ch6_definingclasses.ptx
@@ -423,75 +423,73 @@ public Fraction(Integer num, Integer den) {
-
+
+
- Rearrange the blocks to create a Cat class with instance variables name and age. Implement a default constructor that initializes name to "Unknown" and age to 0. Finally, instantiate a Cat object in main and print its values.
+ Rearrange the blocks to construct a fully encapsulated BankAccount class. The class should feature:
+
+ - A private double balance instance variable.
+ - A public getter method getBalance() that returns the balance.
+ - A public setter method setBalance(double balance) that updates the balance only if the value is non-negative ($ \ge 0 $).
+
- public class Cat {
- private String name;
- private int age;
+ public class BankAccount {
+ private double balance;
- public class Cat {
- private String name = "Unknown";
- private int age = 0;
+ public class BankAccount {
+ public double balance;
- public Cat() {
- this.name = "Unknown";
- this.age = 0;
+ public double getBalance() {
+ return balance;
}
- public void Cat() {
- this.name = "Unknown";
- this.age = 0;
+ public void getBalance() {
+ return balance;
}
- public static void main(String[] args) {
+ public void setBalance(double balance) {
- public void main(String[] args) {
+ public double setBalance(double balance) {
- Cat myCat = new Cat();
+ if (balance >= 0.0) {
+ this.balance = balance;
+ }
+ }
- Cat myCat = Cat();
+ if (balance >= 0.0) {
+ balance = balance;
+ }
+ }
-
- System.out.println("Name: " + myCat.name);
- System.out.println("Age: " + myCat.age);
- }
- }
-
-
- System.out.println("Name: " + Cat.name);
- System.out.println("Age: " + Cat.age);
- }
- }
-
+ }
+
From 732fbdfb230100adda7d2a56831dc781b90580fd Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Mon, 10 Aug 2026 21:26:47 +0300
Subject: [PATCH 04/27] fixed math formatting
---
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 916820a..f1dd27e 100644
--- a/source/ch6_definingclasses.ptx
+++ b/source/ch6_definingclasses.ptx
@@ -431,7 +431,7 @@ public Fraction(Integer num, Integer den) {
- A private double balance instance variable.
- A public getter method getBalance() that returns the balance.
- - A public setter method setBalance(double balance) that updates the balance only if the value is non-negative ($ \ge 0 $).
+ - A public setter method setBalance(double balance) that updates the balance only if the value is non-negative ($ \ge 0 $).
From 809c76e9ce40596e898d4a04c984d38820f9d57b Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Tue, 11 Aug 2026 00:17:44 +0300
Subject: [PATCH 05/27] addedthe question
---
source/ch6_definingclasses.ptx | 43 ++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/source/ch6_definingclasses.ptx b/source/ch6_definingclasses.ptx
index 4375608..734fb2b 100644
--- a/source/ch6_definingclasses.ptx
+++ b/source/ch6_definingclasses.ptx
@@ -1073,6 +1073,49 @@ public int compareTo(Fraction other) { // compare this fraction with another fra
+
+
+
+ Rearrange the blocks to create a Student class that implements Comparable<Student>. The class should feature a private double gpa field and a compareTo method that compares students based on their GPA.
+
+
+
+
+
+ public class Student implements Comparable<Student> {
+ private double gpa;
+
+
+ public class Student extends Comparable<Student> {
+ public double gpa;
+
+
+
+
+ public Student(double gpa) {
+ this.gpa = gpa;
+ }
+
+
+
+
+ public int compareTo(Student other) {
+ return Double.compare(this.gpa, other.gpa);
+ }
+
+
+ public boolean compareTo(Student other) {
+ return this.gpa - other.gpa;
+ }
+
+
+
+
+ }
+
+
+
+
From 27e187a8b26facb798904bce6aa0c1f94556616f Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Tue, 11 Aug 2026 17:07:10 +0300
Subject: [PATCH 06/27] fixed build warning
---
source/ch3_javadatatypes.ptx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/source/ch3_javadatatypes.ptx b/source/ch3_javadatatypes.ptx
index a08b796..d65600d 100644
--- a/source/ch3_javadatatypes.ptx
+++ b/source/ch3_javadatatypes.ptx
@@ -6,7 +6,7 @@
Numeric
-
+
One of the great things about Python is that all of the basic data types are objects.
Integers are objects, floating point numbers are objects, lists are objects, everything.
@@ -156,7 +156,7 @@ public class TempConv {
-
+
Import
From 0eab2e30eb9aa2acbad55dc7482ae3162e224efa Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Wed, 12 Aug 2026 00:27:28 +0300
Subject: [PATCH 07/27] fixed error
---
source/ch2_firstjavaprogram.ptx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/ch2_firstjavaprogram.ptx b/source/ch2_firstjavaprogram.ptx
index 7f1669d..18392e9 100644
--- a/source/ch2_firstjavaprogram.ptx
+++ b/source/ch2_firstjavaprogram.ptx
@@ -374,7 +374,7 @@ Hello World!
Summary & Reading Questions
-
+
-
Java programs must be compiled before execution, unlike Python which is interpreted directly.
From e04249f96273979579491630c6f38299feb4512d Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Wed, 12 Aug 2026 00:32:42 +0300
Subject: [PATCH 08/27] made xml:id more descriptive
---
source/ch2_firstjavaprogram.ptx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/source/ch2_firstjavaprogram.ptx b/source/ch2_firstjavaprogram.ptx
index 18392e9..988d7c9 100644
--- a/source/ch2_firstjavaprogram.ptx
+++ b/source/ch2_firstjavaprogram.ptx
@@ -398,7 +398,7 @@ Hello World!
-
+
Which of the following must be true of every Java program?
@@ -421,7 +421,7 @@ Hello World!
-
+
What is the purpose of the javac command?
@@ -444,7 +444,7 @@ Hello World!
-
+
What symbol does Java use to indicate the end of a statement?
From dd70c1ddedb503da27d23c4987fdcb6258b02202 Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Wed, 12 Aug 2026 00:37:20 +0300
Subject: [PATCH 09/27] fixed error in ch3
---
source/ch3_javadatatypes.ptx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/ch3_javadatatypes.ptx b/source/ch3_javadatatypes.ptx
index a08b796..eeeb724 100644
--- a/source/ch3_javadatatypes.ptx
+++ b/source/ch3_javadatatypes.ptx
@@ -1172,7 +1172,7 @@ public class HistoMap {
Summary & Reading Questions
-
+
-
All variables must be declared with their type before use in Java due to static typing.
From 94374a52bf7b421e7f02c520f72556c3f9ac2ad4 Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Wed, 12 Aug 2026 00:41:44 +0300
Subject: [PATCH 10/27] fixed xml:id
---
source/ch3_javadatatypes.ptx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/ch3_javadatatypes.ptx b/source/ch3_javadatatypes.ptx
index eeeb724..52e7566 100644
--- a/source/ch3_javadatatypes.ptx
+++ b/source/ch3_javadatatypes.ptx
@@ -1195,7 +1195,7 @@ public class HistoMap {
Maps (HashMap and TreeMap) are Java's equivalent to Python dictionaries for storing key-value pairs.
-
+
What is the correct way to declare an ArrayList that will hold String objects in Java?
From a0ef2bd77b916a4a848e54fd962ced31c75317b0 Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Wed, 12 Aug 2026 00:48:37 +0300
Subject: [PATCH 11/27] removed hardcoded xml:id
---
source/ch3_javadatatypes.ptx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/source/ch3_javadatatypes.ptx b/source/ch3_javadatatypes.ptx
index 52e7566..8b4b198 100644
--- a/source/ch3_javadatatypes.ptx
+++ b/source/ch3_javadatatypes.ptx
@@ -1170,7 +1170,7 @@ public class HistoMap {
-
+
Summary & Reading Questions
-
@@ -1235,7 +1235,7 @@ public class HistoMap {
-
+
The process of automatically converting between primitive types and their Object wrapper classes in Java is called:
From 32b14ba0544f4a047cf07a405f0e89f8b53bf79c Mon Sep 17 00:00:00 2001
From: "nshizirungudieumerci@gmail.com"
Date: Thu, 13 Aug 2026 14:22:28 -0400
Subject: [PATCH 12/27] added a select all that apply multiple choice question
---
source/ch9_commonmistakes.ptx | 51 +++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/source/ch9_commonmistakes.ptx b/source/ch9_commonmistakes.ptx
index 4dca391..867a93b 100644
--- a/source/ch9_commonmistakes.ptx
+++ b/source/ch9_commonmistakes.ptx
@@ -228,6 +228,57 @@
+
+
+
+ Based on , select all of the
+ statements that are true about creating objects in Java.
+
+
+
+
+
+ Java requires the new keyword to create a new object.
+
+
+ Correct! Unlike Python, Java needs the new keyword to instantiate an object.
+
+
+
+
+ Writing data = new Scanner(new File("test.dat")); would fix the error.
+
+
+ Correct! Adding new before Scanner properly creates the object and resolves the error.
+
+
+
+
+ Scanner is a constructor of the Scanner class, not a standalone method.
+
+
+ Correct! Because Scanner is a constructor, it must be called with new.
+
+
+
+
+ Java can create objects without a keyword, just like Python.
+
+
+ Incorrect. Unlike Python, Java requires the new keyword to instantiate objects.
+
+
+
+
+ The "cannot find symbol" error here means the Scanner class was not imported.
+
+
+ Incorrect. The Scanner class is imported; the error is caused by the missing new keyword.
+
+
+
+
+
From 44140a88b4bd588e89479ad408c732aa798312eb Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Fri, 14 Aug 2026 16:55:51 +0300
Subject: [PATCH 13/27] empty intro
---
source/ch3_javadatatypes.ptx | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/source/ch3_javadatatypes.ptx b/source/ch3_javadatatypes.ptx
index d65600d..e3da224 100644
--- a/source/ch3_javadatatypes.ptx
+++ b/source/ch3_javadatatypes.ptx
@@ -7,6 +7,9 @@
Numeric
+
+
+
One of the great things about Python is that all of the basic data types are objects.
Integers are objects, floating point numbers are objects, lists are objects, everything.
@@ -156,7 +159,7 @@ public class TempConv {
-
+
Import
From 86657095e0b39f581fe14188914809f8701a1497 Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Fri, 14 Aug 2026 16:58:15 +0300
Subject: [PATCH 14/27] added titleto subsection
---
source/ch3_javadatatypes.ptx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/source/ch3_javadatatypes.ptx b/source/ch3_javadatatypes.ptx
index e3da224..07633af 100644
--- a/source/ch3_javadatatypes.ptx
+++ b/source/ch3_javadatatypes.ptx
@@ -9,7 +9,8 @@
-
+
+ Primitive and Object Data Types
One of the great things about Python is that all of the basic data types are objects.
Integers are objects, floating point numbers are objects, lists are objects, everything.
From 414c176fb5ddfb9c0ff28086b8e38d07971d077e Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Fri, 14 Aug 2026 17:04:46 +0300
Subject: [PATCH 15/27] fixed intro spacing
---
source/ch3_javadatatypes.ptx | 2 --
1 file changed, 2 deletions(-)
diff --git a/source/ch3_javadatatypes.ptx b/source/ch3_javadatatypes.ptx
index 07633af..f2bed97 100644
--- a/source/ch3_javadatatypes.ptx
+++ b/source/ch3_javadatatypes.ptx
@@ -6,8 +6,6 @@
Numeric
-
-
Primitive and Object Data Types
From daa6309f00db99a208de84571fccfeb66c79fd24 Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Fri, 14 Aug 2026 17:48:56 +0300
Subject: [PATCH 16/27] removed the error
---
source/ch4_conditionals.ptx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/ch4_conditionals.ptx b/source/ch4_conditionals.ptx
index 1f99114..49865c6 100644
--- a/source/ch4_conditionals.ptx
+++ b/source/ch4_conditionals.ptx
@@ -611,7 +611,7 @@ public class Ternary {
Summary & Reading Questions
-
+
-
Java requires parentheses around the condition and curly braces for code blocks in if statements, unlike Python which uses indentation alone.
From 01b2ce1a55944411f4f09bf2bb5cb29d294027bd Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Fri, 14 Aug 2026 18:00:03 +0300
Subject: [PATCH 17/27] fixed the question to compare bicycle weights
---
source/ch6_definingclasses.ptx | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/source/ch6_definingclasses.ptx b/source/ch6_definingclasses.ptx
index 734fb2b..ac23c7e 100644
--- a/source/ch6_definingclasses.ptx
+++ b/source/ch6_definingclasses.ptx
@@ -1073,39 +1073,39 @@ public int compareTo(Fraction other) { // compare this fraction with another fra
-
+
- Rearrange the blocks to create a Student class that implements Comparable<Student>. The class should feature a private double gpa field and a compareTo method that compares students based on their GPA.
+ Rearrange the blocks to create a Bicycle class that implements Comparable<Bicycle>. The class should feature a private double weight field and a compareTo method that compares bicycles based on their weight.
- public class Student implements Comparable<Student> {
- private double gpa;
+ public class Bicycle implements Comparable<Bicycle> {
+ private double weight;
- public class Student extends Comparable<Student> {
- public double gpa;
+ public class Bicycle extends Comparable<Bicycle> {
+ public double weight;
- public Student(double gpa) {
- this.gpa = gpa;
+ public Bicycle(double weight) {
+ this.weight = weight;
}
- public int compareTo(Student other) {
- return Double.compare(this.gpa, other.gpa);
+ public int compareTo(Bicycle other) {
+ return Double.compare(this.weight, other.weight);
}
- public boolean compareTo(Student other) {
- return this.gpa - other.gpa;
+ public boolean compareTo(Bicycle other) {
+ return this.weight - other.weight;
}
From 298130dbd481866a107bbc69eb10c7ed3a8f64ea Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Fri, 14 Aug 2026 20:50:19 +0300
Subject: [PATCH 18/27] changed the question
---
source/ch6_definingclasses.ptx | 50 ++++++++++++----------------------
1 file changed, 17 insertions(+), 33 deletions(-)
diff --git a/source/ch6_definingclasses.ptx b/source/ch6_definingclasses.ptx
index 4a270ce..e70519e 100644
--- a/source/ch6_definingclasses.ptx
+++ b/source/ch6_definingclasses.ptx
@@ -424,72 +424,56 @@ public Fraction(Integer num, Integer den) {
-
+
- Rearrange the blocks to construct a fully encapsulated BankAccount class. The class should feature:
-
- - A private double balance instance variable.
- - A public getter method getBalance() that returns the balance.
- - A public setter method setBalance(double balance) that updates the balance only if the value is non-negative ($ \ge 0 $).
-
+ Rearrange the blocks to create a Player class with a private int health instance variable. Implement a getter and a setter that validates health points to remain within 0 and 100.
- public class BankAccount {
- private double balance;
+ public class Player {
+ private int health;
- public class BankAccount {
- public double balance;
+ public class Player {
+ public int health;
-
- public double getBalance() {
- return balance;
+ public int getHealth() {
+ return health;
}
- public void getBalance() {
- return balance;
+ public void getHealth() {
+ return health;
}
-
- public void setBalance(double balance) {
-
-
- public double setBalance(double balance) {
-
-
-
-
-
- if (balance >= 0.0) {
- this.balance = balance;
+ public void setHealth(int health) {
+ if (health >= 0 && health <= 100) {
+ this.health = health;
}
}
- if (balance >= 0.0) {
- balance = balance;
+ public void setHealth(int health) {
+ if (health >= 0 && health <= 100) {
+ health = health;
}
}
-
-
+
}
-
From 154ab33ae72be24e95c334e98a46d0e102551171 Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Sat, 15 Aug 2026 12:31:34 +0100
Subject: [PATCH 19/27] fixed hardcoded xml-id
---
source/ch4_conditionals.ptx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/source/ch4_conditionals.ptx b/source/ch4_conditionals.ptx
index 49865c6..ae66208 100644
--- a/source/ch4_conditionals.ptx
+++ b/source/ch4_conditionals.ptx
@@ -609,7 +609,7 @@ public class Ternary {
-
+
Summary & Reading Questions
-
@@ -630,7 +630,7 @@ public class Ternary {
-
+
Which is a correct Java if statement syntax?
From 73f1d3866797be623617db6ee0b144182dd58ac3 Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Sat, 15 Aug 2026 12:40:08 +0100
Subject: [PATCH 20/27] fixed hardcoded xmlid
---
source/ch5_loopsanditeration.ptx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/source/ch5_loopsanditeration.ptx b/source/ch5_loopsanditeration.ptx
index c0e87a1..098659e 100644
--- a/source/ch5_loopsanditeration.ptx
+++ b/source/ch5_loopsanditeration.ptx
@@ -351,7 +351,7 @@ public class DoWhileExample {
-
+
Summary & Reading Questions
@@ -376,7 +376,7 @@ public class DoWhileExample {
-
+
From 015dd6cda35fb8a4442f0ea1f9319d2e03e10493 Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Sat, 15 Aug 2026 12:40:47 +0100
Subject: [PATCH 21/27] fixed build error
---
source/ch5_loopsanditeration.ptx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/ch5_loopsanditeration.ptx b/source/ch5_loopsanditeration.ptx
index 098659e..769a358 100644
--- a/source/ch5_loopsanditeration.ptx
+++ b/source/ch5_loopsanditeration.ptx
@@ -354,7 +354,7 @@ public class DoWhileExample {
Summary & Reading Questions
-
+
-
Java’s for loop syntax allows you to control loop initialization, condition, and update in one line using the format for (init; condition; update).
From 46ce8387fba055299d800816451ed73c69d6e6d2 Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Sat, 15 Aug 2026 12:44:21 +0100
Subject: [PATCH 22/27] fixed build error
---
source/ch7_recursion.ptx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/ch7_recursion.ptx b/source/ch7_recursion.ptx
index f04f71c..47facf1 100644
--- a/source/ch7_recursion.ptx
+++ b/source/ch7_recursion.ptx
@@ -366,7 +366,7 @@ public class ArrayProcessor {
Summary & Reading Questions
-
+
-
Recursion solves problems by defining a base case and a recursive step; each call reduces the problem size until the base case is reached.
From fbd933fc98812975240eead930b4da67716255ea Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Sat, 15 Aug 2026 12:49:01 +0100
Subject: [PATCH 23/27] fixed build error
---
source/ch8_filehandling.ptx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/ch8_filehandling.ptx b/source/ch8_filehandling.ptx
index a610f37..c53f6fe 100644
--- a/source/ch8_filehandling.ptx
+++ b/source/ch8_filehandling.ptx
@@ -575,7 +575,7 @@ public class DeleteFile {
Summary & Reading Questions
-
+
-
To work with files in Java, you must import specific classes like java.io.File, java.io.FileWriter, and handle exceptions such as IOException.
From d11003935ab11136ee02a8c3d09a99c92a0bde8c Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Sat, 15 Aug 2026 12:54:35 +0100
Subject: [PATCH 24/27] fixed build error
---
source/ch8_filehandling.ptx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/source/ch8_filehandling.ptx b/source/ch8_filehandling.ptx
index c53f6fe..5088761 100644
--- a/source/ch8_filehandling.ptx
+++ b/source/ch8_filehandling.ptx
@@ -573,7 +573,7 @@ public class DeleteFile {
-
+
Summary & Reading Questions
-
@@ -592,7 +592,7 @@ public class DeleteFile {
You can delete a file using the delete() method on a File object, which returns true if successful.
-
+
Which import is needed to create and manipulate files in Java?
From e8d7d360687db7b20c738da4329010521b169bc2 Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Sat, 15 Aug 2026 12:56:32 +0100
Subject: [PATCH 25/27] fuxed xml:id
---
source/ch9_commonmistakes.ptx | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/source/ch9_commonmistakes.ptx b/source/ch9_commonmistakes.ptx
index 64b59cd..b9150eb 100644
--- a/source/ch9_commonmistakes.ptx
+++ b/source/ch9_commonmistakes.ptx
@@ -1,7 +1,7 @@
-
+
Common Mistakes
@@ -219,7 +219,7 @@
Summary & Reading Questions
-
+
-
In Java, every variable must be declared with its type before use; undeclared variables cause compilation errors.
@@ -240,7 +240,7 @@
-
+
What happens if you use a variable in Java without declaring it first?
@@ -263,7 +263,7 @@
-
+
Why must you include import statements for classes like Scanner?
@@ -286,7 +286,7 @@
-
+
What warning occurs when you use an ArrayList without specifying a type?
From 58f61e87cc3b72fd929eee4ca2f8d8b86f35dd4a Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Sat, 15 Aug 2026 12:58:01 +0100
Subject: [PATCH 26/27] fixed wrong attributed xml:id
---
source/ch2_firstjavaprogram.ptx | 2 +-
source/ch3_javadatatypes.ptx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/source/ch2_firstjavaprogram.ptx b/source/ch2_firstjavaprogram.ptx
index 988d7c9..035df2c 100644
--- a/source/ch2_firstjavaprogram.ptx
+++ b/source/ch2_firstjavaprogram.ptx
@@ -81,7 +81,7 @@ $ ls -l Hello.*
The command javac compiles our java source code into compiled byte code and saves it in a file called Hello.class.
Hello.class is a binary file so you won’t learn much if you try to examine the class file with an editor.
- Hopefully you didn’t make any mistakes, but if you did you may want to consult the section for helpful hints on compiler errors.
+ Hopefully you didn’t make any mistakes, but if you did you may want to consult the section for helpful hints on compiler errors.
diff --git a/source/ch3_javadatatypes.ptx b/source/ch3_javadatatypes.ptx
index 8b4b198..6c5b3c2 100644
--- a/source/ch3_javadatatypes.ptx
+++ b/source/ch3_javadatatypes.ptx
@@ -274,7 +274,7 @@ public class TempConv {
- When you see the first kind of error in , where the symbol is on the left side of the equals sign, it usually means that you have not declared the variable. If you have ever tried to use a Python variable that you have not initialized the second error message will be familiar to you. The difference here is that we see the message before we ever try to test our program. More common error messages are discussed in the section .
+ When you see the first kind of error in , where the symbol is on the left side of the equals sign, it usually means that you have not declared the variable. If you have ever tried to use a Python variable that you have not initialized the second error message will be familiar to you. The difference here is that we see the message before we ever try to test our program. More common error messages are discussed in the section .
From 96c3839125f511a3c25eb63fc40373115bfec399 Mon Sep 17 00:00:00 2001
From: Habiba Sorour
Date: Sun, 16 Aug 2026 11:35:18 -0400
Subject: [PATCH 27/27] removed a misplaced git in hte files
---
source/main.ptx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/main.ptx b/source/main.ptx
index 6f4f823..713553a 100644
--- a/source/main.ptx
+++ b/source/main.ptx
@@ -10,7 +10,7 @@
- git
+