Java
Here's an index of all Java specific articles on Programming.Guide.
Java Arrays
- Java Arrays (with examples)
- Maximum length of array
- ArrayIndexOutOfBoundsException
- Arrays vs ArrayLists (and other Lists)
- Matrices and Multidimensional Arrays
- Appending to an array
- Copying an array
- Inserting an element in an array at a given index
- Testing array equality
Types in Java
- Java Basics: Types
- Primitive Types
- Primitives vs Objects and References
- Ranges of Primitive Types
- Wrapper Types
- Autoboxing and unboxing
- Boxed values and equality
- No byte or short literals?
- Byte (class) vs byte (primitive)
- Short (class) vs short (primitive)
- Integer vs int
- Long (class) vs long (primitive)
- Float (class) vs float (primitive)
- Double (class) vs double (primitive)
- Character vs char
- Boolean (class) vs boolean (primitive)
Java Keywords
Java Exceptions
- Throw, Try and Catch
- Java Exception Types
- Chained Exceptions
- Custom Exception
- Difference between Checked and Unchecked Exceptions
- Choosing between Checked and Unchecked Exceptions
- Checked Exceptions: Good or Bad?
- Return Values vs Exceptions
- try + finally
- try-with-resources
- Stack Traces
- Suppressed Exceptions
- throw vs throws vs Throwable
- List of Java Exceptions
Loops in Java
- while loop
- for loop
- for each loop
- do…while loop
- break
- continue
- Beware of accidental semicolons in while and for loops!
Unsigned integers in Java
- Unsigned byte
- Unsigned short
- Unsigned int
- Unsigned long
- Print an unsigned byte
- Parse an unsigned byte
- Convert unsigned byte to int
- Convert unsigned byte to long
- Convert unsigned byte to short
- Convert short to unsigned byte
- Convert int to unsigned byte
- Convert long to unsigned byte
- Compare unsigned bytes
- Print an unsigned short
- Parse an unsigned short
- Convert int to unsigned short
- Convert unsigned short to int
- Convert unsigned short to long
- Convert long to unsigned short
- Compare unsigned shorts
- Print an unsigned int
- Parse an unsigned int
- Convert unsigned int to long
- Convert long to unsigned int
- Compare unsigned ints
- Print an unsigned long
- Parse an unsigned long
- Convert BigInteger to unsigned long
- Convert unsigned long to BigInteger
- Compare unsigned longs
Miscellaneous Java Articles
- Converting a char to an int
- Opening a URL in Android's web browser from within application
- When to create a final class
- Convert from BigInteger to BigDecimal
- Copying Objects
- Formatting byte size to human readable format
- Do interfaces inherit from Object?
- ArrayIndexOutOfBoundsException in for loop
- Creating a custom event
- Convert enum to and from string
- Generating a random number of a certain length
- Wrong results for division?
- Calling method of outer class from inner class
- Random with a random seed
- Convert from BigInteger to short
- Initializing a multidimensional array
- Java Stack Traces: Unknown Source
- Accessing private fields of superclass through reflection
- All Functional Interfaces
- Handling InterruptedException
- Drawing multiline strings with Graphics
- Java Error: Generic array creation
- Lambda Cheat Sheet
- Convert from Number to int
- Removing a range of elements from a list
- Switch Expression
- Calling super.someMethod()
- Local methods (or submethods, or inner methods, or nested methods)
- What is effectively final?
- Convert from BigDecimal to BigInteger
- Convert from Number to long
- Removing trailing comma from comma separated string
- Integers may overflow, but bytes may not?
- Where's the javadoc for values and valueOf methods on enums?!
- Collections.emptyList vs new ArrayList
- Reading the Nth line from a file
- Convert from Number to short
- Calling super()
- How to split a String into an ArrayList
- Convert from BigInteger to long
- Switch Statement
- The meaning of 'this' (with examples)
- -Integer.MIN_VALUE == Integer.MIN_VALUE but -Byte.MIN_VALUE != Byte.MIN_VALUE
- The 'this' reference (with examples)
- Remainder (modulo) operator with negative numbers
- Executing code in comments?!
- Does Java use Pass-by-Value or Pass-by-Reference?
- Marker Interfaces
- Generating a random char (a-z)
- AtomicInteger and equals / Comparable
- Print 2D Matrix
- Abstract interfaces and abstract interface methods
- Convert from BigInteger to int
- N-gram generation
- Switch on enum (with examples)
- Java2D: Increasing line width
- Convert enum to and from int
- Clone and Cloneable
- Calling a default interface method from implementing class
- Java Variables (with examples)
- Ellipsizing strings
- Function Pointers in Java
- Convert from BigInteger to byte
- Find number of regex matches in a String
- Functional Interfaces
- Accessing private fields through reflection
- Double.MIN_VALUE vs Double.MIN_NORMAL
- Initialize list with zeroes
- Why wait must be called in a synchronized block
- Class.this explained
- <...> (less than/greater than) syntax
- Float.MIN_VALUE vs Float.MIN_NORMAL
- Is it wrong to use deprecated methods or classes?
- Removing elements from multiple indexes in a list
- Finding the Nth occurrence of a substring in a String
- Pattern Matching for instanceof
- When should I override equals?
- Using C style macros in Java
- this(…) constructor call (with examples)
- Remove duplicate whitespace in strings
- 5 Java concepts explained: Overloading, overriding, shadowing, hiding, and obscuring
- Java Oddity: How an upcast can save the day
- Convert from Number to byte
- What exactly is immutable?
- Difference between a.getClass() and A.class
- Why's Double.MIN_VALUE is positive? Integer.MIN_VALUE is negative!
- Passing a list as argument to a vararg method
- Print null
- How does the assert keyword work?
- Why you should always override hashCode when overriding equals
- Calling super method of outer class from inner class
- Generating a random String (password, booking reference, etc)
- What does final mean, and are final variables always immutable?
- Why can I access private fields of other objects?