I wrote a sample app when trying out java.
calculator/Calc.java
package calculator;
public abstract class Calc {
public static float Add(float f1, float f2) {
return f1 + f2;
}
public static float Subtract(float f1, float f2) {
return f1 - f2;
}
}
Main.java
import calculator.Calc;
public class Main {
public static void main (String[] args) {
System.out.println("1+1=" + Calc.Add(1f, 1f));
System.out.println("1-0.5=" + Calc.Subtract(1f, 0.5f));
}
}
I managed to compile these classes using jdk into their class files.
Browsing on the web, I found a package called Ant which allows to compile files too. Compiling with Ant also gives me the java class files.
What I want to know is, whats the need for Ant when I can compile my classes directly using jdk without writing any configuration file. Is investing some time into Ant any good when I can build my code using jdk straight away?