Have any questions ? Ask at the Java In General forum. For more basic topics, check out the JavaBeginnersFaq.
Q: How can I run executables written in other languages from Java?
This involves the java.lang.Runtime and java.lang.Process classes. All the details can be found in this article.
As of Java 6, there's a new class for handling this: JavaDoc:java.lang.ProcessBuilder
The Bean Scripting Framework (BSF) library from Apache does this. It facilitates two-way integration between Java and a growing number of scripting languages.
Java 6 introduces an API that does something comparable; see here for an introduction.
Q: What is the Observable class and and the Observer interface?
Some discussion and an example can be found here.
Q: What are Marker (or Tagging) Interfaces, and why don't they have any methods?
Marker interfaces are a mechanism of asserting a fact about a class, without adding any functionality to it. As such, they represent metadata about that class. Some examples are:
Marker interfaces are a misuse of interfaces, and should be avoided. Note that all the above example are rather old, and that no new ones have been added since. Ken Arnold, who was/is behind several Java APIs at Sun, sounds off on marker interfaces here, noting that they should rarely be used.
With the advent of annotations in Java 5 -which are a generic mechanism of adding metadata to a class-, marker interfaces have become obsolete, and no new ones should be defined.
Q: How can I evaluate an expression that a user enters, or create a Java class that includes it as a method?
There are a number of libraries that can take an expression and either compile or interpret it. JEP does interpretation, JEL compilation. For even more flexibility, check out Javassist, which creates actual Java classes.
This Javaranch Journal article demonstrates how to use Javassist to create classes that evaluate mathematical expressions.
Starting with Java 6, there's now an official API for working with the compiler from within Java code.
Q: How can I launch a web browser with a particular URL from Java code?
From Java 6 onwards, the Desktop.browse(...) method does this. JavaDoc:java.awt.Desktop
For Java 5, the BareBonesBrowserLaunch class addresses this for Windows, OS X and Linux/Unix.
Q: How can I implement a licensing scheme for my Java application?
Q: How can I call COM/DLL/ActiveX/.Net objects from Java?
This will involve using the JNI API (specification, introduction). A number of libraries exist that take some of the pain of using JNI out of it, like com4j, JACOB, Jawin, IBM's Rational Java-COM Bridge and j-Interop. Several commercial tools (like EZ Jcom and JNBridge) are also available.
Since JNI only works with C/C++, but not the .Net languages, a .Net wrapper in C++ needs to be created as well if the COM/DLL object was written in one of those languages. An RFE (Request for Enhancement) has been filed years ago for letting JNI code access .Net code directly (see this entry in Sun's Java Bug Database), but it doesn't seem to go anywhere.
JNA implements something similar to JNI, but without the need to create or use C headers and files (it's all Java from the developer's perspective); "article" http://today.java.net/pub/a/today/2009/05/19/protect-your-legacy-code-jna.html
Q: What's up with integers not being equal to one another? The following code prints "true, true, false, true". Shouldn't it be "true, true, true, true"?
The key to understanding this is that the JVM uses a process called "boxing" (or "auto-boxing") when converting an int (like 127) to an Integer object. This involves calling the Integer.valueOf(127) method. The JavaDoc:java.lang.Integer#valueOf(int) says: "Returns a Integer instance representing the specified int value. If a new Integer instance is not required, this method should generally be used in preference to the constructor Integer(int), as this method is likely to yield significantly better space and time performance by caching frequently requested values." What that means is that the valueOf() method has a cache of Integer objects, and if the primitive being boxed is in that range, the cached object is returned. It just so happens that 127 is in that range, but 128 is not. So i and j are the same object, while i1 and j1 are not.
Q: How can I find out from where my class is loaded?
Q: Where can I download old JDK versions, and other APIs that have been deprecated?