toString java of arrays
I have several arrays in a class


I want to implement toString() to print all values.

How to do this?


    public String var1[];   
    public int var2[];
    public String var3[][];
    public int var4[];
    public int var5[][];

    public String toString() {
    
        	for(String s :  var1) {
        		  System.out.println(s.toString());    		  
        	}
    
    
    		return  null;
    	}

That prints all var1[] content but how to print all?? Do I have to put a loop for every one of them?
toString java of arrays
===

I have several arrays in a class


I want to implement toString() to print all values.

How to do this?


    public String var1[];   
    public int var2[];
    public String var3[][];
    public int var4[];
    public int var5[][];

    public String toString() {
    
        	for(String s :  var1) {
        		  System.out.println(s.toString());    		  
        	}
    
    
    		return  null;
    	}

That prints all var1[] content but how to print all?? Do I have to put a loop for every one of them?