Java

Here's an index of all Java specific articles on Programming.Guide.

Java Arrays

  1. Java Arrays (with examples)
  2. Maximum length of array
  3. ArrayIndexOutOfBoundsException
  4. Arrays vs ArrayLists (and other Lists)
  5. Matrices and Multidimensional Arrays
  6. Appending to an array
  7. Copying an array
  8. Inserting an element in an array at a given index
  9. Testing array equality

Types in Java

  1. Java Basics: Types
  2. Primitive Types
  3. Primitives vs Objects and References
  4. Ranges of Primitive Types
  5. Wrapper Types
  6. Autoboxing and unboxing
  7. Boxed values and equality
  8. No byte or short literals?
  9. Byte (class) vs byte (primitive)
  10. Short (class) vs short (primitive)
  11. Integer vs int
  12. Long (class) vs long (primitive)
  13. Float (class) vs float (primitive)
  14. Double (class) vs double (primitive)
  15. Character vs char
  16. Boolean (class) vs boolean (primitive)

Java Keywords

  1. this
  2. catch
  3. finally
  4. throw
  5. throws
  6. try

Java Exceptions

  1. Throw, Try and Catch
  2. Java Exception Types
  3. Chained Exceptions
  4. Custom Exception
  5. Difference between Checked and Unchecked Exceptions
  6. Choosing between Checked and Unchecked Exceptions
  7. Checked Exceptions: Good or Bad?
  8. Return Values vs Exceptions
  9. try + finally
  10. try-with-resources
  11. Stack Traces
  12. Suppressed Exceptions
  13. throw vs throws vs Throwable
  14. List of Java Exceptions

Loops in Java

  1. while loop
  2. for loop
  3. for each loop
  4. do…while loop
  5. break
  6. continue
  7. Beware of accidental semicolons in while and for loops!

Unsigned integers in Java

  1. Unsigned byte
  2. Unsigned short
  3. Unsigned int
  4. Unsigned long
  5. Print an unsigned byte
  6. Parse an unsigned byte
  7. Convert unsigned byte to int
  8. Convert unsigned byte to long
  9. Convert unsigned byte to short
  10. Convert short to unsigned byte
  11. Convert int to unsigned byte
  12. Convert long to unsigned byte
  13. Compare unsigned bytes
  14. Print an unsigned short
  15. Parse an unsigned short
  16. Convert int to unsigned short
  17. Convert unsigned short to int
  18. Convert unsigned short to long
  19. Convert long to unsigned short
  20. Compare unsigned shorts
  21. Print an unsigned int
  22. Parse an unsigned int
  23. Convert unsigned int to long
  24. Convert long to unsigned int
  25. Compare unsigned ints
  26. Print an unsigned long
  27. Parse an unsigned long
  28. Convert BigInteger to unsigned long
  29. Convert unsigned long to BigInteger
  30. Compare unsigned longs

Miscellaneous Java Articles

  1. Converting a char to an int
  2. Opening a URL in Android's web browser from within application
  3. When to create a final class
  4. Convert from BigInteger to BigDecimal
  5. Copying Objects
  6. Formatting byte size to human readable format
  7. Do interfaces inherit from Object?
  8. ArrayIndexOutOfBoundsException in for loop
  9. Creating a custom event
  10. Convert enum to and from string
  11. Generating a random number of a certain length
  12. Wrong results for division?
  13. Calling method of outer class from inner class
  14. Random with a random seed
  15. Convert from BigInteger to short
  16. Initializing a multidimensional array
  17. Java Stack Traces: Unknown Source
  18. Accessing private fields of superclass through reflection
  19. All Functional Interfaces
  20. Handling InterruptedException
  21. Drawing multiline strings with Graphics
  22. Java Error: Generic array creation
  23. Lambda Cheat Sheet
  24. Convert from Number to int
  25. Removing a range of elements from a list
  26. Switch Expression
  27. Calling super.someMethod()
  28. Local methods (or submethods, or inner methods, or nested methods)
  29. What is effectively final?
  30. Convert from BigDecimal to BigInteger
  31. Convert from Number to long
  32. Removing trailing comma from comma separated string
  33. Integers may overflow, but bytes may not?
  34. Where's the javadoc for values and valueOf methods on enums?!
  35. Collections.emptyList vs new ArrayList
  36. Reading the Nth line from a file
  37. Convert from Number to short
  38. Calling super()
  39. How to split a String into an ArrayList
  40. Convert from BigInteger to long
  41. Switch Statement
  42. The meaning of 'this' (with examples)
  43. -Integer.MIN_VALUE == Integer.MIN_VALUE but -Byte.MIN_VALUE != Byte.MIN_VALUE
  44. The 'this' reference (with examples)
  45. Remainder (modulo) operator with negative numbers
  46. Executing code in comments?!
  47. Does Java use Pass-by-Value or Pass-by-Reference?
  48. Marker Interfaces
  49. Generating a random char (a-z)
  50. AtomicInteger and equals / Comparable
  51. Print 2D Matrix
  52. Abstract interfaces and abstract interface methods
  53. Convert from BigInteger to int
  54. N-gram generation
  55. Switch on enum (with examples)
  56. Java2D: Increasing line width
  57. Convert enum to and from int
  58. Clone and Cloneable
  59. Calling a default interface method from implementing class
  60. Java Variables (with examples)
  61. Ellipsizing strings
  62. Function Pointers in Java
  63. Convert from BigInteger to byte
  64. Find number of regex matches in a String
  65. Functional Interfaces
  66. Accessing private fields through reflection
  67. Double.MIN_VALUE vs Double.MIN_NORMAL
  68. Initialize list with zeroes
  69. Why wait must be called in a synchronized block
  70. Class.this explained
  71. <...> (less than/greater than) syntax
  72. Float.MIN_VALUE vs Float.MIN_NORMAL
  73. Is it wrong to use deprecated methods or classes?
  74. Removing elements from multiple indexes in a list
  75. Finding the Nth occurrence of a substring in a String
  76. Pattern Matching for instanceof
  77. When should I override equals?
  78. Using C style macros in Java
  79. this(…) constructor call (with examples)
  80. Remove duplicate whitespace in strings
  81. 5 Java concepts explained: Overloading, overriding, shadowing, hiding, and obscuring
  82. Java Oddity: How an upcast can save the day
  83. Convert from Number to byte
  84. What exactly is immutable?
  85. Difference between a.getClass() and A.class
  86. Why's Double.MIN_VALUE is positive? Integer.MIN_VALUE is negative!
  87. Passing a list as argument to a vararg method
  88. Print null
  89. How does the assert keyword work?
  90. Why you should always override hashCode when overriding equals
  91. Calling super method of outer class from inner class
  92. Generating a random String (password, booking reference, etc)
  93. What does final mean, and are final variables always immutable?
  94. Why can I access private fields of other objects?