An array of int
s is an object too, but that "class" doesn't override the toString
method from Object
, which is responsible for the "weird output" you see:
In other words, this method returns a string equal to the value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
Print the array using Arrays.toString
instead.
System.out.println(Arrays.toString(a.czynnikiPierwsze(69)));