I want to know if (and how) I can put my reversed array from my method ArrayReverse in the array result(where the ?????????? are) in my main method.
The code should print out "Funktioniert"
My code:
public class blubb {
public static void main(String[] args) {
char[] array = {'t', 'r', 'e', 'i', 'n', 'o', 'i', 't', 'k', 'n', 'u', 'F'};
char[] result= new char[??????????];
result=ArrayReversed(array);
for (int i = 0; i < ergebnis.length; i++) {
System.out.println(ergebnis[i]);
}
}
public static char[] ArrayReversed(char[] arr) {
char [] blubb= new char[arr.length];
for (int i = arr.length-1; i >=0; i--) {
blubb[i]=arr[i];
}
return blubb;
}
}
resultvariable?psvmis not an abbreviation commonly used to refer topublic static void main... please don't use it.