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 / nisha sharma
class Stringb
{
public static void main(String a[])
{
StringBuffer sb=new StringBuffer("Hello");
StringBuffer sb1=sb.deleteCharAt(1);
StringBuffer sb2=sb1.deleteCharAt(3);
System.out.println(sb2);
}
}
Is This Answer Correct ? | 4 Yes | 6 No |
Post New Answer View All Answers
What is coupling in oops?
Question: Write a program that prints a paycheck. Ask the program user for the name of the employee, the hourly rate, and the number of hours worked. If the number of hours exceeds 40, the employee is paid “time and a half”, that is, 150 percent of the hourly rate on the hours exceeding 40. Be sure to use stepwi se refine ment and break your solution into several functions. Use the int_name function to print the dollar amount of the check.
What is the difference between static polymorphism and dynamic polymorphism?
What is the diamond problem in inheritance?
write string class as your own class in java without using any built-in function
Where You Can Use Interface in your Project
How can you overcome the diamond problem in inheritance?
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?
What is debug class?what is trace class? What differences are between them? With examples.
What is overloading in oops?
How to call a non virtual function in the derived class by using base class pointer
What are the data types in oop?
can inline function declare in private part of class?
What is byval and byref? What are differences between them?
when to use 'mutable' keyword and when to use 'const cast' in c++