|
|
|
|
|
Last week we began to take a look at object-oriented concepts
on our way to understanding how a language such as Java
might benefit the computational scientist. Before we can
know how Java can help anyone, though, we have to know
something about Java. So, welcome to our Java primer.
Of course, at some level there has to be consideration for the specific platform in question. However, rather than force a different compile for each machine, Java code runs on the Java Virtual Machine (JVM). The JVM interacts with compiled Java code the same on all machines, but it interacts differently with different machines. Therefore, once the JVM is installed on a machine, any Java code compiled on any machine should be able to run. Another important feature of Java is automatic memory management. This seem quite nifty to those of us who have spent much time in a language that uses dynamic memory allocation, such as C and C++. As anyone in this category can tell you, memory problems can cause some outlandish behavior from your code, and they can be nearly impossible to track at times. In Java, though, memory management is done automatically. This means you don't have to allocate space for a buffer, and you don't have to free it. This means that things like out-of-bounds errors are greatly reduced, and large core files could be a thing of the past! The area where Java is quite unlike many other languages is the maturity of its existing standard libraries. There are classes for everything from manipulating strings to drawing pictures, and much more. These classes make the job of the developer much easier, as he can grab one that is close to what he wants and then extend it to get the desired behavior. To see what is currently available, you can visit Sun's Java website at http://java.sun.com. If it all sounds like wine and roses, don't be duped. Learning to code effectively in Java is no mean task, especially if Go To Page: 1 2
The copyright of the article OOhh ... It's Java! in Scientific Computing is owned by . Permission to republish OOhh ... It's Java! in print or online must be granted by the author in writing.
|
|
|
|