Duvida sobre PrintWriter or BufferedWriter?

2 respostas
P

Olá,

estou em duvida qual seria a certa ???

abs

  1. String s = “write a line to a file”;
  2. w.print(s + “\n”);

Which is true?

A w can be of either type PrintWriter or BufferedWriter.

B w can be of NEITHER type PrintWriter nor BufferedWriter.
C w can be of type PrintWriter, but NOT of type BufferedWriter.
D w can be of type BufferedWriter, but NOT of type PrintWriter.

2 Respostas

B

Resposta C.

A classe BufferedWriter possui o método write(), não print().

Lavieri

print, como o nome sugere, só existe no PrintWrite

Criado 15 de junho de 2009
Ultima resposta 15 de jun. de 2009
Respostas 2
Participantes 3