java 17901

  1. Why is it faster to process a sorted array than an unsorted array?
  2. Why is subtracting these two times (in 1927) giving a strange result?
  3. Is Java “pass-by-reference” or “pass-by-value”?
  4. Avoiding != null statements
  5. Why don't Java's +=, -=, *=, /= compound assignment operators require casting?
  6. Read/convert an InputStream to a String
  7. Proper use cases for Android UserManager.isUserAGoat()?
  8. Differences between HashMap and Hashtable?
  9. Create ArrayList from array
  10. How do I generate random integers within a specific range in Java?
  11. Why is char[] preferred over String for passwords?
  12. Iterate through a HashMap
  13. Creating a memory leak with Java
  14. When to use LinkedList over ArrayList?
  15. How do I convert a String to an int in Java?
  16. What is a serialVersionUID and why should I use it?
  17. How to efficiently iterate over each entry in a 'Map'?
  18. In Java, difference between package private, public, protected, and private
  19. Why is printing “B” dramatically slower than printing “#”?
  20. Initialization of an ArrayList in one line
  21. How do I fix android.os.NetworkOnMainThreadException?
  22. How can I create an executable JAR with dependencies using Maven?
  23. Does finally always execute in Java?
  24. How can I test if an array contains a certain value?
  25. How do I call one constructor from another in Java?
  26. How to use java.net.URLConnection to fire and handle HTTP requests
  27. “implements Runnable” vs. “extends Thread”
  28. What is reflection and why is it useful?
  29. Why does this code using random strings print “hello world”?
  30. How do I declare and initialize an array in Java?
  31. Lookup Java enum by string value
  32. How do you assert that a certain exception is thrown in JUnit 4 tests?
  33. Breaking out of nested loops in Java
  34. How to avoid Java code in JSP files?
  35. What's the simplest way to print a Java array?
  36. Java inner class and static nested class
  37. How to generate a random alpha-numeric string?
  38. What's the difference between @Component, @Repository & @Service annotations in Spring?
  39. Comparing Java enum members: == or equals()?
  40. How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version
  41. Sort a Map<Key, Value> by values
  42. What is a JavaBean exactly?
  43. Difference between StringBuilder and StringBuffer
  44. Why use getters and setters/accessors?
  45. Does Java support default parameter values?
  46. Why is executing Java code in comments with certain Unicode characters allowed?
  47. How to split a string in Java
  48. How do I create a Java string from the contents of a file?
  49. How can I convert a stack trace to a string?
  50. Why does Java have transient fields?