Where am I wrong in this program? without print function with void in reverse functio it works fine.
public class Question1 {
public static void main( String [] args ) {
// TODO Auto-generated method stub
char [] myName = { 'H', 'A', 'S', 'H', 'I', 'M' };
char temp = reverse ( myName );
print ( temp );
}
public static char reverse ( char [] array ) {
for ( int i = 5; i >= 0; i-- ) {
char reverseArray = array [i];
}
return reverse;
}
public static void print ( char array ) {
System.out.println ( array );
}
}