63.4k views
4 votes
(Java) Can anyone help me with this question ???

(Java) Can anyone help me with this question ???-example-1

1 Answer

5 votes
Your print function is too specific. It should be more like:

for( int i = 0; i < data.length; i++ )
System.out.print( data[ i ] );


append() would be something like:

int[] c = new int[ a.length + b.length ];
int j = 0;
for( int i = 0; i < a.length; i++ )
c[ i ] = a[ i ];

for( int i = j; i < ( b.length + a.length ); i++ )
c[ i ] = b[ i ];
return( c );

User Laugre
by
8.5k points