Question 8 of 76 from exam 1Z0-808: Java SE 8 Programmer I

Question 8 of 76 from exam 1Z0-808: Java SE 8 Programmer I

Question

Given the code fragment:

. class X {

public void printFilecontent ()
/* code goes here */
throw new IOException () +

3

3
public class Test {

{

public static void main(string[]

X xobj = new XO;
xobj.printFilecontent ();

args)

{

Which two modifications should you make so that the code compiles successfully?

0 A) Replace line 8 with public static void main(string[] args) throws Exception {

CB) Replace line 10 with
try {
xob}. printFileContent ();
}
catch (Exception e) { }
catch (IOException e) { }

OC) Replace line 2 with public void printFileContent () throws IOException {
OD) Replace line 4 with throw IoException("Exception raised");

OE) At line 11, insert throw new IOException ();

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D. E.

AC.