98-388 Exam QuestionsBrowse all questions from this exam

98-388 Exam - Question 31


HOTSPOT -

You are writing a Java method named countdown.

The method must meet the following requirements:

✑ Accept an int parameter named start

✑ Display all numbers from start to zero in decrements of one

How should you complete the code? To answer, select the appropriate code segments in the answer area.

NOTE: Each correct selection is worth one point.

Hot Area:

Exam 98-388 Question 31
Show Answer
Correct Answer:
Exam 98-388 Question 31

References:

https://docs.oracle.com/javase/tutorial/java/javaOO/arguments.html

Discussion

3 comments
Sign in to comment
mc
Apr 28, 2021

correct!

alejandro355416
Apr 28, 2021

>0 for second option

Qudaci
Sep 14, 2021

for it to be 'from start to zero', it needs to be >= or the zero will be skipped. predecrementation takes no effect here

VishalPt
Aug 11, 2021

0>=i public class Test{ public static void main(String []args){ for (int i=5;i>=0;--i){ System.out.println("Value i :" + (i)); } } }