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
Зарегистрируйся сейчас
или Подпишись на будущие тесты