What you are seeing is the default representation of Java objects, i.e., examples of classes that do not implement toString()
. Vectors are part of this group.
I cannot see why you would like to print a vector other than for debugging purposes. In this case, use a debugger. Debuggers often have a mode of visualization of vectors and other enumerable objects and usually list the elements exactly the same as you want them to. Here has some instructions on how to use a debugger in Eclipse. In other Ides it is quite similar.
If you really want to print the value of the vector, whatever the reason, suppose you are using System.out.println()
for this, just do:
for (String regiao : arrayRegioes) {
System.out.println(regiao);
}
In this way, you are traversing the elements of the vector (calling them regiao
) and exhibiting.
How are you printing this amount?
– user28595
System.out.print("arrayRegioes: " + arrayRegioes);
– durtto
Now your question has radically changed. The answer no longer serves.
– user28595
Diego, I create a new question. I really need this help. You can help me?
– durtto
@durtto I suggest to reverse your question to what was before and make a new one. At least this will suit those who have the same doubt.
– Pablo Almeida