Question: Given the following code, and assuming readData( has been called from main(), what is the output if EX is read into codeStr? public void main(String

 Given the following code, and assuming readData( has been called from

Given the following code, and assuming readData( has been called from main(), what is the output if "EX" is read into codeStr? public void main(String [] args) { Scanner kbd = new Scanner(System.in); readData( kbd); } catch (Exception e) { System.out.println("An Exception occurred"); } finally { kbd.close(); System.out.println("Done."); } } public static void readData( Scanner in ) { String numStr. codeStr; try { codeStr = in.next(); numStr = Character.toString( codeStr.charAt( 2)); int num = Integer.parseInt( numStr); } catch (NumberFormatException nfe) { System.out.println( numStr + " is not a number."); } } a. is not a number. Done. O b. An Exception occurred Done. O c. An Exception occurred O d. Done

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!