Strings in Java

Doesn’t end in /0(null), hence strings are immutable. (can’t be changed, if need to, create a new string, like c)

pointers aren’t accessible, in java, things point to other things sure, but you can’t manipulate the memory address.

The garbage collector will get rid of the memory that isn’t directly addressed, around 15 milliseconds.

For Immutable, only for non-primative data types(apparently objects no, idk why, probably since it is a combination of them)


with the \n, \\, \t, etc, they are counted as one character
No Null character!

there is concat function, just use + to concatenate

in order to have example sentences, you can use system tokenizer

Could be used for making columns/tables, reading a sentence at once.

Good, just be careful and make sure to use an escape character if you want to use ., since period(.) exists.


no negative/out of bounds ones, basically allows you to return a string’s character, one specific letter.
First 32(0-31) characters can’t be printed,

(same as c, - means first one wins, + means second one wins, 0 means equal)
(lexicographically, there are ASCII values, gets the sum of both, and compare.

Nevermind, not new.
Stores a subset of the original one, out of bounds of it, you get a StringOutOfBoundsConception error from it(like -1).


IF string not found, get -1, can’t return out of bounds answer. IndexOf finds only first instance of it.
lastindexOf gets the last one.
boolean contains is indexof, but in boolean form, checking if a string contains something, true or false.
Some other ones, toLowerCase, toUpperCase, trim(reduces it), and more.


For the second one, while it works, it is really inefficient, since it constantly throws out the old iterative strings, so instead use StringBuilder, so you can build it up over time.
Can’t always use StringBuilder, since you would need to continously compare twice for one comparison.
With sb.toString
