Question: Question 4 5 ( 1 point ) Which throws clause is valid for the following method? public static double [ ] filterTimeData ( String fileName,

Question 45(1 point)
Which throws clause is valid for the following method?
public static double[] filterTimeData(String fileName, int numValues, double lowThreshold, double highThreshold){
FileInputStream inStream = new FileInputStream(fileName);
Scanner fileScnr = new Scanner(inStream);
double inputVal;
double[] resultArray = new double[numValues];
for (int i =0; i < numValues; ++i){
inputVal = fileScnr.nextDouble();
if (inputVal <0.0){
throw new Exception("Invalid negative time");
}
if ((inputVal >= lowThreshold) && (inputVal <= highThreshold)){
resultArray[i]= inputVal;
}
}
return resultArray;
}
Question 45 options:
throws IndexOutOfBoundsException, InputMismatchException
throws FileNotFoundException, IndexOutOfBoundsException, InputMismatchException
throws FileNotFoundException, Exception
throws FileNotFoundException

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!