Fill in the blanks to define a function ''myFunc'', which throws an exception if its parameter is less than 0. void myFunc(int a
17 Answers
New Answerho do work out this
1/29/2017 6:15:06 PM
marvellous gwenzi17 Answers
New AnswerAns: void myFunc(int arg) throws IllegalArgumentException { if(arg <0) throw newIllegalArgumentException(); }
Fill in the blanks to declare a method that takes one argument of type int. public int myFunc( x) return x*10; I need help
Drag and drop from the options below to create a method that throws an IOException if the parameter is negative. Answer :- public void do(int x) throws IOException { if(x<0) { throw new IOException(); } }
public void myFunct(int arg) throws IllegalArgumentException { if(arg<0) { throw new IllegalArgumentException(); } }
Drag and drop from the options below to create a method that throws an IOException if the parameter is negative ANS:public void do(int x) throws IOException { if(x<0) { throw new IOException(); } }
public void do(int x) throws IOException { if(x<0) { throw new IOException(); } }
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message