//Square root of a no. using command line argument
class Calculator {
double i;
double x = Math.sqrt(i);
}
class SquareRoot {
public static void main(String arg[]) {
Calculator a = new Calculator();
a.i = Integer.parseInt(arg[0]);
System.out.println("The square root of " + a.i + " is " + a.x);
}
}
Мой вывод:
The square root of 64 is 0.0
Что не так с моим кодом?