-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
76 changed files
with
1,526 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,21 +3,20 @@ name: Linter | |
on: [pull_request] | ||
|
||
jobs: | ||
markdown-linter: | ||
name: "Markdown Linter" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# markdown-linter: | ||
# name: "Markdown Linter" | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# - name: markdownlint-cli | ||
# uses: nosborn/[email protected] | ||
# with: | ||
# files: . | ||
# config_file: .markdownlint.yaml | ||
|
||
- name: markdownlint-cli | ||
uses: nosborn/[email protected] | ||
with: | ||
files: . | ||
config_file: .markdownlint.yaml | ||
|
||
markdown-link-check: | ||
name: "Markdown Link Checker" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: gaurav-nelson/[email protected] | ||
# markdown-link-check: | ||
# name: "Markdown Link Checker" | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# - uses: gaurav-nelson/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Abstract Classes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# ArrayList | ||
|
||
Java comes with a generic growable array. It is called | ||
an `ArrayList`. | ||
|
||
```java | ||
import java.util.ArrayList; | ||
|
||
void main() { | ||
ArrayList<String> names = new ArrayList<>(); | ||
names.add("John Wick"); | ||
|
||
System.out.println(names); | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Add an item | ||
|
||
To add an item to an `ArrayList` you use the `.add` | ||
method. | ||
|
||
```java | ||
import java.util.ArrayList; | ||
|
||
void main() { | ||
ArrayList<String> names = new ArrayList<>(); | ||
names.add("The Bowery King"); | ||
names.add("Caine"); | ||
|
||
System.out.println(names); | ||
} | ||
``` | ||
|
||
The way this works is conceptually the | ||
same as the growable array that we went over earlier. | ||
|
||
All you need to know though is that you can add | ||
as many items as you will and the container will grow | ||
dynamically. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Get an item | ||
|
||
To get an item at a given index in an `ArrayList` | ||
you should use `.get` | ||
|
||
```java | ||
import java.util.ArrayList; | ||
|
||
void main() { | ||
ArrayList<String> names = new ArrayList<>(); | ||
names.add("Winston Scott"); | ||
|
||
String name = names.get(0); | ||
System.out.println(name); | ||
} | ||
``` | ||
|
||
If the index you picked is greater than the number of elements in the `ArrayList` | ||
it will throw an `IndexOutOfBoundsException` | ||
|
||
```java,panics | ||
import java.util.ArrayList; | ||
void main() { | ||
ArrayList<String> names = new ArrayList<>(); | ||
names.add("Killa Harkan"); | ||
String name = names.get(10); | ||
System.out.println(name); | ||
} | ||
``` |
Oops, something went wrong.