Given two strings like x=?hello? and y=?open?, remove any
character from string x which is also used in string y,
thus making the result x=?hll?.
Answer Posted / guest
public static void main(String[] args) {
String str_x = "hello";
String str_y = "open";
StringBuffer result = new StringBuffer();
for (int i=0; i<str_x.length();i++){
if (str_y.indexOf(str_x.charAt(i)) < 0)
result.append(str_x.charAt(i));
}
System.out.print(result);
}
| Is This Answer Correct ? | 5 Yes | 4 No |
Post New Answer View All Answers
Can main method override?
I have One image (means a group photo ) how to split the faces only from the image?............ please send the answer nagadurgaraju@gmail.com thanks in advace...
How is class defined?
What is a class in oop?
What is difference between polymorphism and inheritance?
What is interface in oop?
What does it mean when someone says I oop?
What are the benefits of interface?
How long to learn object oriented programming?
What is oops and its features?
how to get the oracle certification? send me the answer
What is interface? When and where is it used?
What is abstraction oop?
write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).
What is encapsulation oop?