Oracle Java SE 8 Programmer II 1z0-809 Question # 9 Topic 1 Discussion

Oracle Java SE 8 Programmer II 1z0-809 Question # 9 Topic 1 Discussion

1z0-809 Exam Topic 1 Question 9 Discussion:
Question #: 9
Topic #: 1

Given the code fragment:

public static void main (String [ ] args) throws IOException {

BufferedReader br = new BufferedReader (new InputStremReader (System.in));

System.out.print (“Enter GDP: “);

//line 1

}

Which code fragment, when inserted at line 1, enables the code to read the GDP from the user?


A.

int GDP = Integer.parseInt (br.readline());


B.

int GDP = br.read();


C.

int GDP = br.nextInt();


D.

int GDP = Integer.parseInt (br.next());


Get Premium 1z0-809 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.