Since i am new to java, so please tell me that is there any way by which i can convert integer array to primitive int?? if yes, give some code.

Since i am new to java, so please tell me that is there any way by which i can convert integer array to primitive int?? if yes, give some code.

im confused, an integer array should contain an array of integers, and integers are already primitive?... but see here:http://stackoverflow.com/questions/564392/converting-an-array-of-objects-to-an-array-of-their-primitive-types and here:http://stackoverflow.com/questions/718554/how-to-convert-an-arraylist-containing-integers-to-primitive-int-array

Edited 4 Years Ago by DavidKroukamp: n/a

What i actually mean is that if at index 0, value stored is 49 and at index 1, the value stored is 50 then can i take it as 4950? can it be done?

What i actually mean is that if at index 0, value stored is 49 and at index 1, the value stored is 50 then can i take it as 4950? can it be done?

well taking from your last posts maybe this?:

String tmp="";//variable to concatenate integers to string
        for(int i=0;i<ret.length;i++){
            if(ret[i]!=0) {
                System.out.print(ret[i]+",");
            tmp+=ret[i];//add integer to previous string value 
            }
        }

Edited 4 Years Ago by DavidKroukamp: n/a

This question has already been answered. Start a new discussion instead.