From c70d7e401c45b5c84c2f9c937f805a850dd5e1a3 Mon Sep 17 00:00:00 2001 From: Xevion Date: Mon, 2 Mar 2020 22:22:44 -0600 Subject: [PATCH] update study with List.set, compareTo and access priviledge sections (need more) --- study/STUDY.MD | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/study/STUDY.MD b/study/STUDY.MD index 0d6dfe1..c8c7875 100644 --- a/study/STUDY.MD +++ b/study/STUDY.MD @@ -40,6 +40,9 @@ If you find something incorrect, feel free to contribute and modify. - [char And int Are Interchangeable](#char-and-int-are-interchangeable) - [Classes Call From Where They Originate](#classes-call-from-where-they-originate) - [List.remove() Element Shifting](#listremove-element-shifting) + - [List.set() requires a element to work](#listset-requires-a-element-to-work) + - [How .compareTo Functions](#how-compareto-functions) + - [Access Privileges](#access-privileges) @@ -473,4 +476,18 @@ public static void clearInteger(ArrayList arr) { if(arr.get(i) % 2 == 0) arr.remove(i--); } -``` \ No newline at end of file +``` + +### List.set() requires a element to work + +Lists will not dynamically resize to accommodate the `.set()` method, i.e. to use set at a specified index, the index must be a *valid* position in that array to access using `.get(int i)` or `.remove(int i)`. + +### How .compareTo Functions + +I've personally been doing `String.compareTo(String other)` incorrectly for a little too long. Here is how it works: + +For each character in the array, compare for equality until one does not match. If + +### Access Privileges + +`public`, `protected` and `private` are the three possible \ No newline at end of file