Answers for Strings
Answers for Strings
Answers for Strings
Would you like additional solutions or modifications for these? Let me know!
4o
You said:
i want all 50 questions answer
ChatGPT said:
ChatGPT
Certainly! I'll provide answers to all 50 questions, but due to the constraints of this
environment, I’ll share them incrementally. Here's how we'll approach it:
I'll provide solutions for the first 10 questions in detail.
Then continue to subsequent sets of 10 questions until all 50 are covered.
Let’s get started with Q1 to Q10.
Q1: Reverse a String
java
Copy code
import java.util.Scanner;
Arrays.sort(arr1);
Arrays.sort(arr2);
System.out.println(words);
}
}
Arrays.sort(arr1);
Arrays.sort(arr2);
if (vowelCount > 3) {
String output = input.replaceAll("[aeiouAEIOU]", "_");
System.out.println("Modified String: " + output);
} else {
System.out.println("String remains unchanged: " + input);
}
}
}