Java: String Methods

There are lots of methods available for manipulating strings in Java, which is great because it takes some of the workload off developers and gives us more time to reinvent the wheel and drink coffee. They’re all pretty self-explanatory, and we’ll briefly look at a few of them here.

Continue reading

Advertisements

Java: Numbers and Numeric Promotion

Numbers, kind of a backbone of, well, most things when you think about it. This post will cover how Java treats typed numbers in code, which are called literals or sometimes also referred to as magic numbers (depending on how sarcastic the person reviewing your code is), and how numeric promotion works. What possible depth could there be to number literals in Java you ask? I’m glad you asked (but I bet you aren’t!). Continue reading

Java: Garbage Collection

Garbage collection in Java is kind of, well, garbage. What is it? It’s the process by which the Java Virtual Machine cleans up no longer used pieces of memory (objects that are out of scope, for example), in order to keep memory free. It’s a bit of an odd beast, though. You can explicitly call it, but sometimes it will run, sometimes it won’t. Continue reading