Consider the code:

public class MyCalculator {
    public static void main(String[] args) {
     // Insert here
    }
}
Which of the following should be inserted in the code to print 3.1416?
Explanation
Method System.out.printf() prints formatted text, Math.PI is a constant for PI number and correct format string is %6.4f which stands for "Print a floating point number prepending spaces to occupy not less then 6 characters with precision of 4 numbers after dot."

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Продовжуйте вивчати
тести з Java
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести