Java (not to be confused with JavaScript or JScript or JS) is a general-purpose object-oriented programming language designed to be used in conjunction with the Java Virtual Machine (JVM). "Java platform" is the name for a computing system that has installed tools for developing and running Java programs. Use this tag for questions referring to the Java programming language or Java platform tools.
Is it possible to call a constructor from another (within the same class, not from a subclass)? If yes how? An
I have a String[] with values like so: public static final String[] VALUES = new String[] {"AB","BC","CD","AE
Considering this code, can I be absolutely sure that the finally block always executes, no matter what somethi
I got an error while running my Android project for RssReader. Code: URL url = new URL(urlToRssFeed); SAXPa
I want to package my project in a single executable JAR for distribution. How can I make a Maven project pack
I generated two matrices of 1000 x 1000: First Matrix: O and #. Second Matrix: O and B. Using the following
How do I unit test (using xUnit) a class that has internal private methods, fields or nested classes? Or a fun
I wanted to create a list of options for testing purposes. At first, I did this: ArrayList<String> plac
Eclipse issues warnings when a serialVersionUID is missing. The serializable class Foo does not declare
How can I convert a String to an int in Java? My String contains only numbers, and I want to return the numbe
I've always been one to simply use: List<String> names = new ArrayList<>(); I use the inte
In Java, are there clear rules on when to use each of access modifiers, namely the default (package private),
I just had an interview where I was asked to create a memory leak with Java. Needless to say, I felt pretty du
If I have an object implementing the Map interface in Java and I wish to iterate over every pair contained wit
Until today, I thought that for example: i += j; Was just a shortcut for: i = i + j; But if we try this:
How do I generate a random int value in a specific range? I have tried the following, but those do not work: A
I have an array that is initialized like: Element[] array = {new Element(1), new Element(2), new Element(3)};
What are the differences between a HashMap and a Hashtable in Java? Which is more efficient for non-threaded