Current Page:
NeXtMidas Training
Background
Why use Java?
|
|
- Why use Java?
- Java is object-oriented.
- Makes it much easier to extend and reuse existing code. This results in less
total code being written compared to C or Fortran.
- Lower development and maintenance costs.
- Java's package naming scheme.
- This guarantees a unique namespace for all Java programs anywhere in the world.
Any Java libraries on the internet can be downloaded and used without fear of namespace
collisions.
- Solves a common issue with sharing C and Fortran code.
- Java allows method overloading.
- This allows a single method name to be reused for different data types or different
numbers of arguments. For example:
public double myFunc(double a, double b);
public double myFunc(double a, double b, double c);
public float myFunc(float a, float b);
- Everything in Java is "stringable."
- Given a string, anything can automatically be appended to it using the plus operator
(
+ ). Numbers are automatically converted to strings. For example:
String debug = "Pass="+i+" CenterFreq="+freq;
- Easier to add debug information than in C or Fortran.
- Exceptions in Java have a stack trace.
- Every exception in Java comes with an automatic stack trace; it even specifies
the line number in the source code that caused the exception.
- Makes debugging a program much, much easier.
- Java is "platform independent."
- Though a few low-level differences still exist (such as path names differing between
Linux and Windows), Java makes it easy to create a program that runs on any platform which has a JVM
(Linux, Solaris, Windows, etc).
- Minimal cost to support additional platforms.
|
|
|