Академический Документы
Профессиональный Документы
Культура Документы
16q
Number: 98-388
Passing Score: 800
Time Limit: 120 min
File Version: 1.0
98-388
https://www.gratisexam.com/
Sections
1. Understand Java fundamentals
2. Work with data types, variables, and expressions
3. Implement flow control
4. Compile and debug code
https://www.gratisexam.com/
Exam A
QUESTION 1
You have the following code segment. Line numbers are included for reference only.
https://www.gratisexam.com/
A. -44
B. -40.0
C. 40.0
D. 44.0
Correct Answer: B
Section: Understand Java fundamentals
Explanation
Explanation/Reference:
QUESTION 2
You need to analyze the following code segment. Line numbers are included for reference only.
https://www.gratisexam.com/
What is the output of line 12 when you run printInt()?
A. 0
B. 1
C. 2
D. 3
Correct Answer: A
Section: Understand Java fundamentals
Explanation
Explanation/Reference:
QUESTION 3
HOTSPOT
https://www.gratisexam.com/
How should you complete the code? To answer, select the appropriate code segments in the answer area.
Hot Area:
https://www.gratisexam.com/
Correct Answer:
Explanation/Reference:
https://www.gratisexam.com/
References:
https://docs.oracle.com/javase/7/docs/api/java/io/InputStreamReader.html
QUESTION 4
DRAG DROP
You need to evaluate the following Java program. Line numbers are included for reference only.
Which three values will be displayed in sequence? To answer, move the appropriate values from the list of values to the answer area and arrange them in the
correct order.
https://www.gratisexam.com/
Correct Answer:
Explanation/Reference:
QUESTION 5
HOTSPOT
You need to evaluate the following code. Line numbers are included for reference only.
https://www.gratisexam.com/
Use the drop-down menus to select the answer choice that answers each question based on the information presented in the code.
Hot Area:
https://www.gratisexam.com/
Correct Answer:
https://www.gratisexam.com/
Section: Work with data types, variables, and expressions
Explanation
Explanation/Reference:
QUESTION 6
DRAG DROP
https://www.gratisexam.com/
You need to create an int array named numbers initialized with num1, num2, and num3.
How should you complete the code? To answer, drag the appropriate code segment to the correct position. Each code segment may be used once, more than
once, or not at all. You may need to drag the split bar between panes or scroll to view content.
Correct Answer:
Explanation/Reference:
Example:
int[] numbers = new int[] {num1, num2, num3}
References:
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html
https://www.gratisexam.com/
https://alvinalexander.com/blog/post/java/java-faq-create-array-int-example-syntax
QUESTION 7
HOTSPOT
How should you complete the code? To answer, select the appropriate code segments in the answer area.
Hot Area:
Correct Answer:
https://www.gratisexam.com/
Section: Work with data types, variables, and expressions
Explanation
Explanation/Reference:
References:
https://docs.oracle.com/javase/7/docs/api/java/lang/StringBuilder.html
https://www.tutorialspoint.com/java/lang/stringbuilder_substring_end.htm
QUESTION 8
DRAG DROP
The method accepts an int value named number, raises the value to the second power, and returns the negative value of the result.
How should you complete the code? To answer, drag the appropriate code segment to the correct position. Each code segment may be used once, more than
once, or not at all. You may need to drag the split bar between panes or scroll to view content.
https://www.gratisexam.com/
Correct Answer:
Explanation/Reference:
QUESTION 9
The question requires that you evaluate the underlined text to determine if it is correct.
You should use an int data type to store the numeric value 3,000,000,000 (3 billion) so that the least amount of memory is used.
Review the underlined text. If it makes the statement correct, select “No change is needed.” If the statement is incorrect, select the answer choice that makes the
statement correct.
A. No change is needed.
B. a short
C. a byte
D. a long
https://www.gratisexam.com/
https://www.gratisexam.com/
Correct Answer: D
Section: Work with data types, variables, and expressions
Explanation
Explanation/Reference:
QUESTION 10
You need to evaluate the following code segment:
Correct Answer: C
Section: Work with data types, variables, and expressions
Explanation
Explanation/Reference:
QUESTION 11
DRAG DROP
https://www.gratisexam.com/
You are writing a Java method.
How should you complete the code? To answer, drag the appropriate code segment to the correct position. Each code segment may be used once, more than
once, or not at all. You may need to drag the split bar between panes or scroll to view content.
Correct Answer:
https://www.gratisexam.com/
Section: Work with data types, variables, and expressions
Explanation
Explanation/Reference:
References:
http://www.tutorialspoint.com/java/java_strings.htm
QUESTION 12
You work as a Java programmer.
A. Double.valueOf(numberString);
B. double.parseDouble(numberString);
C. String.parseDouble(numberString);
D. Double.parseDouble(numberString);
Correct Answer: B
Section: Work with data types, variables, and expressions
Explanation
Explanation/Reference:
References:
https://www.javacodeexamples.com/convert-string-to-primitive-example/140
QUESTION 13
HOTSPOT
You are writing a Java console program. The program accepts command line arguments.
You need to ensure that the main method parses and handles each command line argument.
How should you complete the code? To answer, select the appropriate code segments in the answer area.
Hot Area:
https://www.gratisexam.com/
Correct Answer:
https://www.gratisexam.com/
Section: Work with data types, variables, and expressions
Explanation
Explanation/Reference:
QUESTION 14
HOTSPOT
https://www.gratisexam.com/
The method must meet the following requirements:
How should you complete the code? To answer, select the appropriate code segments in the answer area.
Hot Area:
https://www.gratisexam.com/
Correct Answer:
https://www.gratisexam.com/
Section: Implement flow control
Explanation
Explanation/Reference:
https://www.gratisexam.com/
QUESTION 15
DRAG DROP
To open a new account, a user must meet one the following requirements:
How should you complete the code? To answer, drag the appropriate operator to the correct position. Each operator may be used once, more than once, or not at
all. You may need to drag the split bar between panes or scroll to view content.
Correct Answer:
https://www.gratisexam.com/
Section: Implement flow control
Explanation
Explanation/Reference:
References:
https://www.tutorialspoint.com/java/java_basic_operators.htm
QUESTION 16
The question requires that you evaluate the underlined text to determine if it is correct.
The logError method can be invoked by code in all classes in the same package as the Logger class.
Review the underlined text. If it makes the statement correct, select “No change is needed.” If the statement is incorrect, select the answer choice that makes the
statement correct.
A. No change is needed
B. only by the Logger class
C. only by the Logger class and classes in the same package that inherit from it
D. by all classes in all packages
Correct Answer: C
Section: Compile and debug code
Explanation
Explanation/Reference:
https://www.gratisexam.com/
https://www.gratisexam.com/
https://www.gratisexam.com/