This is another problem that could have been solved using library functions. I've restricted myself to arrays and Strings. You can remove some of my code if you use a StringBuilder.
```java
Scanner scan = new Scanner(System.in);
System.out.println("Enter your string: ");
String input = scan.nextLine();
String vowels = "";
//Extract Vowels
for(int i = 0; i<input.length();i++) {
String s = input.substring(i, i+1);
if (s.matches("[aeiou]")) {
vowels = vowels + s;
}
}
//Reverse Vowels
String reverseVowels = "";
for(int i = 0; i<vowels.length();i++) {
String s = vowels.substring(i, i+1);
reverseVowels = s + reverseVowels;
}
// Replace Vowels
String newString = "";
int count = 0;
for(int i = 0; i<input.length();i++) {
String s = input.substring(i, i+1);
if (s.matches("[aeiou]")) {
newString = newString + reverseVowels.substring(count, count+1);
count++;
} else {
newString = newString + s;
}
}
System.out.println(newString);
```