В чем отличие между System.out.format и System.out.printf?
Alexander Gromov
19 уровень
В чем отличие между System.out.format и System.out.printf?
Комментарии (2)
- популярные
- новые
- старые
Для того, чтобы оставить комментарий Вы должны авторизоваться
Roman Sharun
5 июня 2021, 13:39
методы format и printf эквивалентны друг другу. System.ou является PrintStream объектом, поэтому вы можете вызывать PrintStream методы System.out. Таким образом, вы можете использовать format или в printf
0
Evgeny Strokov Enterprise Java Developer в СберТех
3 июня 2021, 08:03
Javadoc for PrintStream.printf.
An invocation of this method of the form out.printf(l, format, args) behaves in exactly the same way as the invocation out.format(l, format, args).
+1