0

Following java programs gives me this outcome like [I@4554617c

public class Firstlast6 {

    public static void main(String[] args) {
        int testnums[] = {6,1,5,3};
        firstLast6(testnums);

        System.out.println(testnums);
    }

    public static boolean firstLast6(int[] nums){
        if (nums[0] == 6){
            return true;
        }else if (nums[nums.length-1] == 6){
            return true;
        }else {
            return false;
        }
    }
}
Saravana
  • 12,647
  • 2
  • 39
  • 57
Sekhar
  • 5
  • 5

1 Answers1

0

Yes, arrays do not have nice formatted toString() method...

Try Arrays.toString(testnums) instead...

Usagi Miyamoto
  • 6,196
  • 1
  • 19
  • 33