Skip to content

Commit a1aada0

Browse files
committed
Minor edits
1 parent 563264b commit a1aada0

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

source/code/projects/FileTruncate/FileTruncate/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.IO;
33

44
class Program
@@ -33,3 +33,4 @@ static void Main()
3333
// End solution
3434
}
3535
}
36+

source/diag/cla/WeightedRectangle.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Shape <|-- Rectangle
2+
Rectangle <|-- WeightedRectangle
3+
4+
class Shape{
5+
<<Abstract>>
6+
+GetArea() double*
7+
+ToString() string
8+
}
9+
10+
class Rectangle{
11+
+ «property» Width: int
12+
+ «property» Length: int
13+
+ GetArea() int
14+
+ Rectangle(wiP: int, leP: int)
15+
+ ToString() string
16+
+ Equals(rP: Rectangle) bool
17+
}
18+
19+
class WeightedRectangle{
20+
+ «property» Weight: int
21+
+ WeightedRectangle(wiP: int, leP: int, weP: int)
22+
+ Equals(wrP: WeightedRectangle) bool
23+
}

source/lectures/collections/arrays_of_objects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ The syntax is straightforward once understood that jagged arrays are *exactly* a
128128

129129
In this example, it should be clear that `jaggedArray[row]` is itself an array, and hence that we can use e.g., `jaggedArray[row].Length` or `jaggedArray[row][arrayCell]`.
130130

131-
### When to Use Rectangular vs. Jagged Arrays
131+
### Deciding Between Rectangular and Jagged Arrays
132132

133133
The main distinction between rectangular and jagged arrays is that the former is more consistent with its sizing--in other words, in a rectangular array, each array housed within it will be the same size in every row, by definition. In contrast, jagged arrays are not as consistent. This can be seen in the difference between how rectangular and jagged arrays are initialized. Recall that, when initializing a rectangular array, the number of rows and columns is required, but only the number of rows is required for a jagged array.
134134

0 commit comments

Comments
 (0)