Question: Which is output when inputVal is 0 ? try { inputVal = scnr . nextInt ( ) ; if ( inputVal < 0 ) {

Which is output when inputVal is 0?try { inputVal = scnr.nextInt(); if (inputVal <0){ throw new Exception("Input should be positive"); } System.out.print("Input squared: "+ inputVal * inputVal);}catch (Exception e){ System.out.print(e.getMessage());}Question 7 options:Input squared: 0ExceptionInput should be positiveInput squared: 0Input should be positive

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!