Question: Which is output when inputVal is - 5 ? try { inputVal = scnr . nextInt ( ) ; if ( inputVal < 0 )
Which is output when inputVal is
try
inputVal scnrnextInt;
if inputVal
throw new ExceptionInput should be positive";
System.out.printInput squared: inputVal inputVal;
catch Exception e
System.out.printegetMessage;
Question options:
Input squared:
Exception
Input should be positive
Input squared:
Input should be positive
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
