java - in a class cant make input array equal to another array -


so have code going convert strings integers, quicksort it, , turns integers strings. code works no problem want try put integers strings same input array instead of making whole other array, did not work, didnt change input. instead made int string array method return me in new array, when debugged how wanted be. , made input array equal new array put in, , return whole bunch of jumbled letters?

public class runner {     static void singleletterarrayalphabeticalorganizer(string[] a)     {     int[] number = stoianditos.singlestoi(a);//makes string integer     quicksort.sort(number,0,a.length-1);//quicksorts integers     string[] a1 = stoianditos.singleitos(number);//makes integers strings     // tried put intead of a1 gave me same result     = a1;     //problem area: suppoused make input given same a1 dont have make new array in main class(if thats im running it) instead of using exsisting array } } 

you cannot change parameters passed in method. if want pass sorted array of strings, change return type of method "string [] " instead of "void " , "return a1;"


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -