Console.writer ().JAVA

Программисты JAVA общаются здесь
Anonymous
Console.writer ().

Сообщение Anonymous »

console.writer (). println () отображает «Введите 3 слова» после console.readline ().
Может ли кто -нибудь объяснить, почему? < /p>
class Class3{
public static void main(String... args){
Console console = System.console();
if(console == null){
throw new RuntimeException("No console");
}else{
//System.out.println("Enter 3 words");
//console.format("Enter 3 words");
console.writer().println("Enter 3 words");

List strings = new ArrayList();
for(int i=0;i
Выход:
Вывод приложения < /p>
Я попытался использовать system.out.println () и console.format () и оба печати «Введите 3 слова», прежде чем приложение примет 3 строки < /p>

Подробнее здесь: https://stackoverflow.com/questions/795 ... ut-println

Вернуться в «JAVA»