Introduction to Programming Using Java

Here you have the best Microsoft 98-388 practice exam questions

  • You have 42 total questions to study from
  • Each page has 5 questions, making a total of 9 pages
  • You can navigate through the pages using the buttons at the bottom
  • This questions were last updated on December 19, 2024
Question 1 of 42

HOTSPOT -

You need to evaluate the following code segment. Line numbers are included for reference only.

Use the drop-down menus to select the answer choice that answers each question based on the information presented in the code.

NOTE: Each correct selection is worth one point.

Hot Area:

    Correct Answer:

Question 2 of 42

You have the following code segment. Line numbers are included for reference only.

What is the output of line 07?

    Correct Answer: B

Question 3 of 42

HOTSPOT -

You are interviewing for a job as a Java developer.

You are presented with the following code. Line numbers are included for reference only.

You need to evaluate what happens when the code runs.

Use the drop-down menus to select the answer choice that answers each question based on the information presented in the code.

NOTE: Each correct selection is worth one point.

Hot Area:

    Correct Answer:

Question 4 of 42

HOTSPOT -

You need to evaluate the following Java program. Line numbers are included for reference only.

Use the drop-down menus to select the answer choice that answers each question based on the information presented in the code.

NOTE: Each correct selection is worth one point.

Hot Area:

    Correct Answer:

    References:

    https://docs.oracle.com/javase/tutorial/java/data/numberformat.html

Question 5 of 42

You need to analyze the following code segment. Line numbers are included for reference only.

What is the output of line 12 when you run printInt()?

    Correct Answer: A

    The num variable is first declared inside the first if block but this variable is local to that block and does not affect the rest of the method. Then, num is declared again and initialized to 1 in line 9. The addOne() method is called with num passed as an argument, but it operates on a local copy of num. The change made to the local num variable in addOne() doesn't affect the num variable in printInt(). After returning from the addOne() function call, the num variable in printInt() is unchanged and still 1. Subtracting 1 from it results in 0.