|General Forum Rules:
- Always Google first. A simple search can oftentimes answer your questions immediately.
- If you have a problem with your code, post relevant portions of your code or else it becomes amazingly hard to help you out.
- No posting homework questions. If your question looks even remotely like a homework question, it will be closed as soon as it comes to the moderator's attention.
Frequently Asked Questions:
- Where can I get a Java compiler?
You can download the official Java Software Development Kit (JDK) from Sun's Java site, http://java.sun.com. There also exist a number of third-party Java compilers such as IBM's Jikes and GNU's Java compiler GCJ (now part of the GNU Compiler Collection, or GCC).
- Command line compilers are fine, but where can I get an IDE?
There are a number of IDEs for Java, both free and otherwise. Probably the simplest Java IDE out there is BlueJ. For an intermediate IDE, you can try out JCreator. If you want a more complex, full-featured IDE, you can try either NetBeans or Eclipse.
- Where can I get a good introduction to Java?
In addition to the Java documentation, Sun also has an excellent tutorial available on their web site. You should check here first for any basic questions about the language before posting to this forum.
- The Java documentation is excellent, huh? Well then, where is it?
The current Java documentation (for version 1.4.2) can be found at http://java.sun.com/j2se/1.4.2/docs/api/index.html.
- What's the difference between a Java applet and a Java application?
When it comes right down to it, not a whole lot. The fundamental difference is that an applet is a program that is designed to be embedded within another application, most commonly a web browser, whereas an application stands alone and can be run independent from any other applications (save for the Java Virtual Machine).
- I hear that Java doesn't have pointers. Is this true?
Technically speaking, this is correct. However, Java does have references, which are very similar to pointers in many respects, but overall are more limited in use. The reason for this is that in languages such as C, pointers can often lead to various unforeseen memory leakages, hard to read, and hard to debug code. So the designers of Java (along with other modern languages) decided not to include pointers.
- I hear that because Java is interpreted that it is inherently slow. Is this really the case?
No, it is not. Since around 1997, Java has had what is known as a Just-In-Time (JIT) compiler. What this does is that it takes a program's code and actually compiles it to the native environment at run-time, thus making the Java code even faster. Furthermore, the JVM can dynamically recompile sections of code at runtime which effectively optimizes sections of code for specific situations. For further information, see these Java benchmark tests against C++.
This FAQ was written by and is currently maintained by Mike De Palatis. Please email me if you have any comments or suggestions.