I get these weird characters when I try to print out a vector element!

前端 未结 4 747
青春惊慌失措
青春惊慌失措 2021-01-21 15:29

I\'m using Netbeans. When I run the program below, I get this as output [I@de6ced! How come?

import java.util.Arrays;
import java.util.Vector;

publ         


        
4条回答
  •  一整个雨季
    2021-01-21 16:28

    It looks like the int's are becoming Integers using autoboxing so you are getting an object reference instead of the value. Still seems weird as it should call the correct toString and end up with "5".

提交回复
热议问题