Skip to content

Commit

Permalink
Merge pull request #52 from LaunchCodeEducation/chapter-typos
Browse files Browse the repository at this point in the history
Corrects typos in Chapters 1-5
  • Loading branch information
ColinBrock authored Nov 28, 2023
2 parents 8048ac3 + b71fb5e commit 87a4935
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 42 deletions.
10 changes: 5 additions & 5 deletions content/classes/reading/srp/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ originalAuthor: Sally Steuterman # to be set by page creator
originalAuthorGitHub: gildedgardenia # to be set by page creator
reviewer: Kimberly Horan # to be set by the page reviewer
reviewerGitHub: codinglikeagirl42 # to be set by the page reviewer
lastEditor: # update any time edits are made after review
lastEditorGitHub: # update any time edits are made after review
lastMod: # UPDATE ANY TIME CHANGES ARE MADE
lastEditor: Colin Brock # update any time edits are made after review
lastEditorGitHub: ColinBrock # update any time edits are made after review
lastMod: 2023-11-27 # UPDATE ANY TIME CHANGES ARE MADE
---

As we wrap up our whirlwind tour of classes, we want you think a bit about how to go about building good classes. Doing so is more of an art than a science, and it will take you lots of practice and time. However, there are a few rules that we’ve pointed out to help guide you. Here’s one more.
As we wrap up our whirlwind tour of classes, we want you to think a bit about how to go about building good classes. Doing so is more of an art than a science, and it will take you lots of practice and time. However, there are a few rules that we’ve pointed out to help guide you. Here’s one more.

"The **single responsibility principle** states that every module or class should have responsibility over a single part of the functionality provided by the software, and that responsibility should be entirely encapsulated by the class."

It isn’t always clear what “responsibility over a single part of the functionality” means. However, it is often very clear what it doesn’t mean. For example, we wouldn’t think of adding functionality to the `Student` class that tracked all of the data for each of the student’s classes, such as catalog number, instructor, and so on. Those are clearly different areas of responsibility. One way to interpret the single responsibility principle is to say that “classes should be small.”

As you go forth and create classes, the main thing to keep in mind is that your skill and judgement in creating Java classes will improve over time. The best way to improve is to write lots of code, ask lots of questions, and continue learning!
As you go forth and create classes, the main thing to keep in mind is that your skill and judgment in creating Java classes will improve over time. The best way to improve is to write lots of code, ask lots of questions, and continue learning!

If you are interested in learning more about [Single Responsibility Principle](https://en.wikipedia.org/wiki/Single_responsibility_principle), you can check out the entry on Wikipedia.

10 changes: 5 additions & 5 deletions content/control-flow-and-collections/exercises/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ originalAuthor: Sally Steuterman # to be set by page creator
originalAuthorGitHub: gildedgardenia # to be set by page creator
reviewer: John Woolbright # to be set by the page reviewer
reviewerGitHub: jwoolbright23 # to be set by the page reviewer
lastEditor: # update any time edits are made after review
lastEditorGitHub: # update any time edits are made after review
lastMod: # UPDATE ANY TIME CHANGES ARE MADE
lastEditor: Colin Brock # update any time edits are made after review
lastEditorGitHub: ColinBrock # update any time edits are made after review
lastMod: 2023-11-27 # UPDATE ANY TIME CHANGES ARE MADE
---

<!-- TODO: Add link to Chapter 1, naming conventions -->
Expand Down Expand Up @@ -65,9 +65,9 @@ Now you are ready to start creating new classes and practice using different col

{{% notice blue "Note" "rocket" %}}
Some characters, like a period `"."`, have special meanings when used with
the `split` method. They cannot be used as-is for the deliminator.
the `split` method. They cannot be used as-is for the delimiter.

To use these characters as the deliminator, we must *escape* their special
To use these characters as the delimiter, we must *escape* their special
meanings. Instead of `.split(".")`, we need to use `.split("\\.")`.
{{% /notice %}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ originalAuthor: Sally Steuterman # to be set by page creator
originalAuthorGitHub: gildedgardenia # to be set by page creator
reviewer: John Woolbright # to be set by the page reviewer
reviewerGitHub: jwoolbright23 # to be set by the page reviewer
lastEditor: # update any time edits are made after review
lastEditorGitHub: # update any time edits are made after review
lastMod: # UPDATE ANY TIME CHANGES ARE MADE
lastEditor: Colin Brock # update any time edits are made after review
lastEditorGitHub: ColinBrock # update any time edits are made after review
lastMod: 2023-11-27 # UPDATE ANY TIME CHANGES ARE MADE
---

To write an **ArrayList** version of the program, we will have to introduce
several new Java concepts, including the class `ArrayList`. We will also
review different kinds of `for` loops used in Java.

Before going any further, we suggest you run the `ArrayListGradebook`
program in IntelliJ. You can view this program in `java-web-dev-projects/chapter-example/student-example` directory.
program in IntelliJ. You can view this program in the `java-web-dev-projects/chapter-example/student-example` directory.
Once you’ve done that, let’s look at what is happening in the Java source code.

```java {linenos=table}
Expand Down
8 changes: 4 additions & 4 deletions content/data-types/exercises/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ originalAuthor: Courtney Frey # to be set by page creator
originalAuthorGitHub: Courtney Frey # to be set by page creator
reviewer: Kimberly Horan # to be set by the page reviewer
reviewerGitHub: codinglikeagirl42 # to be set by the page reviewer
lastEditor: Courtney Frey # update any time edits are made after review
lastEditorGitHub: speudusa # update any time edits are made after review
lastMod: 2023-06-27T09:27:57-05:00 # UPDATE ANY TIME CHANGES ARE MADE
lastEditor: Colin Brock # update any time edits are made after review
lastEditorGitHub: ColinBrock # update any time edits are made after review
lastMod: 2023-11-27 # UPDATE ANY TIME CHANGES ARE MADE
---

## Getting Started
Expand Down Expand Up @@ -167,7 +167,7 @@ The first sentence of _Alice’s Adventures in Wonderland_ is below. Store this
> Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, 'and what is the use of a book,' thought Alice 'without pictures or conversation?'
{{% notice blue "Note" "rocket" %}}
You may want to write the string above on more than one line in your solution. Java 17 and IntelliJ gives you a few options to do so. The easiest, thanks to your IDE, is to press Enter as you type the string. IntelliJ will close the string and concatenate it with the next line to create one longer string.
You may want to write the string above on more than one line in your solution. Java 17 and IntelliJ give you a few options to do so. The easiest, thanks to your IDE, is to press Enter as you type the string. IntelliJ will close the string and concatenate it with the next line to create one longer string.
{{% /notice %}}

### E. Strings
Expand Down
8 changes: 4 additions & 4 deletions content/data-types/reading/data-types/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ originalAuthor: Courtney Frey # to be set by page creator
originalAuthorGitHub: Courtney Frey # to be set by page creator
reviewer: Kimberly Horan # to be set by the page reviewer
reviewerGitHub: codinglikeagirl42 # to be set by the page reviewer
lastEditor: Terri Penn # update any time edits are made after review
lastEditorGitHub: tpenn # update any time edits are made after review
lastMod: 2023-08-31T06:16:54-05:00 # UPDATE ANY TIME CHANGES ARE MADE
lastEditor: Colin Brock # update any time edits are made after review
lastEditorGitHub: ColinBrock # update any time edits are made after review
lastMod: 2023-11-27 # UPDATE ANY TIME CHANGES ARE MADE
---

## Static vs. Dynamic Typing
Expand Down Expand Up @@ -133,7 +133,7 @@ Primitive data types are immutable and can be combined to build larger data stru
`String` is a non-primitive data type, also called an _object type_. As we saw in the `String` table above, object types have methods which we can call using dot notation. Primitive data types do not have methods.

{{% notice blue "Note" "rocket" %}}
Primitive data types in Java begin with a lower case letter, while object data types in Java begin with a capital letter.
Primitive data types in Java begin with a lowercase letter, while object data types in Java begin with a capital letter.
{{% /notice %}}

Later in this chapter, we will explore the Array and Class object types.
Expand Down
8 changes: 4 additions & 4 deletions content/data-types/reading/more-data-types/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ originalAuthor: Courtney Frey # to be set by page creator
originalAuthorGitHub: Courtney Frey # to be set by page creator
reviewer: Kimberly Horan # to be set by the page reviewer
reviewerGitHub: codinglikeagirl42 # to be set by the page reviewer
lastEditor: # update any time edits are made after review
lastEditorGitHub: # update any time edits are made after review
lastMod: # UPDATE ANY TIME CHANGES ARE MADE
lastEditor: Colin Brock # update any time edits are made after review
lastEditorGitHub: ColinBrock # update any time edits are made after review
lastMod: 2023-11-27 # UPDATE ANY TIME CHANGES ARE MADE
---

## Arrays
Expand Down Expand Up @@ -95,7 +95,7 @@ Visually, we can represent these four variables as shown below.

Since `int` is a primitive type, the variables `firstCatAge` and `secondCatAge` function like separate boxes, each one holding the integer value `11`. On the other hand, `myCat` is a reference variable, since it refers to an object of type `Cat`. The variable actually stores the memory address of the object, which we visualize as an arrow pointing from the variable box to where the data is stored. Instead of holding the actual `Cat` data, `myCat` stores directions for finding the data in memory.

When we to assign `myCat` to another variable, as in `Cat sameCat = myCat`, we do NOT create a second copy of the object or its data. Instead, we make a second arrow pointing to the same memory location.
When we assign `myCat` to another variable, as in `Cat sameCat = myCat`, we do NOT create a second copy of the object or its data. Instead, we make a second arrow pointing to the same memory location.

The distinction between object types and primitives is important, if subtle. As you continue learning Java, you will see that object types are handled differently in essential and important ways.

Expand Down
8 changes: 4 additions & 4 deletions content/data-types/reading/some-java-practice/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ originalAuthor: Courtney Frey # to be set by page creator
originalAuthorGitHub: Courtney Frey # to be set by page creator
reviewer: Kimberly Horan # to be set by the page reviewer
reviewerGitHub: codinglikeagirl42 # to be set by the page reviewer
lastEditor: Terri Penn # update any time edits are made after review
lastEditorGitHub: tpenn # update any time edits are made after review
lastMod: 2023-08-31T06:16:54-05:00 # UPDATE ANY TIME CHANGES ARE MADE
lastEditor: Colin Brock # update any time edits are made after review
lastEditorGitHub: ColinBrock # update any time edits are made after review
lastMod: 2023-11-27 # UPDATE ANY TIME CHANGES ARE MADE
---

Let’s move beyond our “Hello, World” example and explore a simple temperature conversion program. We want our function to convert a Fahrenheit temperature to Celsius.
Expand Down Expand Up @@ -55,7 +55,7 @@ There are several new concepts introduced in this example. We will look at them

## Java Packages

Line 1 of of the program above, `package org.launchcode.java.demos.lsn1datatypes;` declares the package in which the file resides. For this simple program, your code could run without this line. However, you want to get used to always declaring the package of your Java classes.
Line 1 of the program above, `package org.launchcode.java.demos.lsn1datatypes;` declares the package in which the file resides. For this simple program, your code could run without this line. However, you want to get used to always declaring the package of your Java classes.

Packages help to **encapsulate** your code. Encapsulation refers to the practice of shielding your code from outside influences. It’s an essential component of good object oriented programming, and package declaration in Java is just one application of this principle. Without declaring a package, a Java class exists within the default package. In larger applications, leaving all classes in the default package risks naming conflicts and bugs.

Expand Down
8 changes: 4 additions & 4 deletions content/data-types/studio/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ originalAuthor: Courtney Frey # to be set by page creator
originalAuthorGitHub: Courtney Frey # to be set by page creator
reviewer: Kimberly Horan # to be set by the page reviewer
reviewerGitHub: codinglikeagirl42 # to be set by the page reviewer
lastEditor: Courtney Frey # update any time edits are made after review
lastEditorGitHub: speudusa # update any time edits are made after review
lastMod: 2023-06-27T09:27:57-05:00 # UPDATE ANY TIME CHANGES ARE MADE
lastEditor: Colin Brock # update any time edits are made after review
lastEditorGitHub: ColinBrock # update any time edits are made after review
lastMod: 2023-11-27 # UPDATE ANY TIME CHANGES ARE MADE
---

Get cozy with Java syntax by writing a console program that calculates the area of a circle based on input from the user.

## Creating your class
Since you’re still new to Java and IntelliJ, we’ll provide some extra direction the first studio.
Since you’re still new to Java and IntelliJ, we’ll provide some extra direction for the first studio.

1. Within the `datatypes-studio` directory create the following directory structure: `src/main/java`.
1. Create a new package named `org.launchcode` by right-clicking (or ctrl-clicking for some Mac users) on the `java` directory and selecting _New_ > _Package_. Be sure to enter `org.launchcode` as the full name, or your package won’t be created in the correct location.
Expand Down
8 changes: 4 additions & 4 deletions content/intro-and-setup/first-java-project/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ originalAuthor: Sally Steuterman # to be set by page creator
originalAuthorGitHub: gildedgardenia # to be set by page creator
reviewer: Kimberly Horan # to be set by the page reviewer
reviewerGitHub: codinglikeagirl42 # to be set by the page reviewer
lastEditor: # update any time edits are made after review
lastEditorGitHub: # update any time edits are made after review
lastMod: # UPDATE ANY TIME CHANGES ARE MADE
lastEditor: Colin Brock # update any time edits are made after review
lastEditorGitHub: ColinBrock # update any time edits are made after review
lastMod: 2023-11-27 # UPDATE ANY TIME CHANGES ARE MADE
---

Following the "Hello, World" trend, let's create a new IntelliJ project.
Expand Down Expand Up @@ -58,7 +58,7 @@ Following the "Hello, World" trend, let's create a new IntelliJ project.
You can click on any of the green triangles to the left of the class and function names or choose *Run* from your top menu bar.

{{% notice blue "Note" "rocket" %}}
If you are having trouble running your program, try selecting the Main project from the *Configuations* menu.
If you are having trouble running your program, try selecting the Main project from the *Configurations* menu.
This is located between the green hammer and the green *Run* triangle on the top left of your menu.
{{% /notice %}}

Expand Down
8 changes: 4 additions & 4 deletions content/intro-and-setup/intellij/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ originalAuthor: Sally Steuterman # to be set by page creator
originalAuthorGitHub: gildedgardenia # to be set by page creator
reviewer: Kimberly Horan # to be set by the page reviewer
reviewerGitHub: codinglikeagirl42 # to be set by the page reviewer
lastEditor: # update any time edits are made after review
lastEditorGitHub: # update any time edits are made after review
lastMod: # UPDATE ANY TIME CHANGES ARE MADE
lastEditor: Colin Brock # update any time edits are made after review
lastEditorGitHub: ColinBrock # update any time edits are made after review
lastMod: 2023-11-27 # UPDATE ANY TIME CHANGES ARE MADE
---

IntelliJ is an **integrated development environment (IDE)**. An IDE is like a text
editor on steroids. It not only allows you to write and edit code, but also contains many
features that enhance the coding experience. IntelliJ offers
code completion hints, debugging, and even it's own compiler. We'll be using it throughout
code completion hints, debugging, and even its own compiler. We'll be using it throughout
this course, so it's time to get familiar with some of the basics.

## Install IntelliJ
Expand Down

0 comments on commit 87a4935

Please sign in to comment.