Home > OS >  .toStrings method is not working what should i do?
.toStrings method is not working what should i do?

Time:11-06

.tostrings  method is not working in intellij idea do I need to install something extra ??

I was trying to sout(Arrays.tostring()); for a multi dimensional array but its asking me to create a sperate function , does intelij not have the .tostrings method pre defined ??

CodePudding user response:

Your array is not multi dimensional. Be sure you use the correct Arrays import!

import java.util.Arrays;

public class Main {

    public static void main(String[] args) {
        int[] arr={1,3,3,34,4,5,5};
        System.out.println(Arrays.toString(arr));
    }
}
  • Related