What is wrong with this code I\'m getting wrong output. I don\'t know what\'s wrong, I hope you could help me:
public class Main{
public static void main(Strin
The toString() for arrays is broken. You need
import java.util.Arrays;
System.out.println("numbers are" + Arrays.toString(data));
The same applies for Arrays.equals(), Arrays.hashCode(). The Array, Arrays, ArrayUtils classes add functionality you might like arrays to have.
http://docs.oracle.com/javase/7/docs/api/java/util/Arrays.html
http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Array.html
http://docs.oracle.com/javase/7/docs/api/java/sql/Array.html
http://commons.apache.org/proper/commons-lang/javadocs/api-3.1/org/apache/commons/lang3/ArrayUtils.html
However, you may find that you really want ArrayList instead.