I am getting array bound error but to my mind, array starts from 0, so what is wrong with this code?
public class Quadratic {
public static void main(String
You don't have an item in args[0] and/or args[1]. You need to check that there are enough arguments in the array.
double b = args.length>=1?Double.parseDouble(args[0]):0.0;
double c = args.length>=2?Double.parseDouble(args[1]):0.0;
If there are no arguments in the array, then it means that you didn't pass an argument into the program or you didn't pass enough arguments.