[Solved] How to print values in Java?


I suggest to implement the toString() method for each pojo and then simply use System.out.println(yourObject)

for example for the Pessoa class you could write something like this:

@Override
public String toString()
{
  return String.format("Pessoa [idade=%s, nome=%s, altura=%s, peso=%s, matricula=%s]", idade, nome, altura, peso, matricula);
}

2

solved How to print values in Java?