Is it good to set System.out.println in a separate method?

I work with a piece of code that seems strange to me. The code I'm working on is part of an import utility that takes a CSV file and imports data into a database.

Inside the code, I see:

ImportUtils.printf("Validation started");

When I look at this method, it just calls System.out.println:

public static void printf(String s) {
    System.out.println(s);
}

Are there any advantages to this? Could this pose a problem in the future?

+3
source share
6 answers

System.out.println API . ( , Log4j, SLF4J ). , . , , ... (, ), , .

+15

. , , , System.out - , System.setOut(). , .

+6

, - , ImportUtils.printf.

? , , .

+5

printf , printf , printf .

, , . printf.

+2

Java, " Fortran ", C.

, , - C- API. "DisplayText" - , , .

+1

, - - .

, system.out. , . , , . , . ..

. , system.out. - , .

+1

Source: https://habr.com/ru/post/1714239/


All Articles