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


Please Help Members By Posting Answers For Below Questions

What is coupling in oops?

814


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.

938


What is the difference between static polymorphism and dynamic polymorphism?

834


What is the diamond problem in inheritance?

807


write string class as your own class in java without using any built-in function

2195


Where You Can Use Interface in your Project

1600


How can you overcome the diamond problem in inheritance?

952


Give an example where we have to specifically use C programming language and C++ programming language cannot be used?

1375


What is debug class?what is trace class? What differences are between them? With examples.

1842


What is overloading in oops?

824


How to call a non virtual function in the derived class by using base class pointer

5878


What are the data types in oop?

814


can inline function declare in private part of class?

3954


What is byval and byref? What are differences between them?

1930


when to use 'mutable' keyword and when to use 'const cast' in c++

1873