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?.

Answers were Sorted based on User's Feedback



Given two strings like x=?hello? and y=?open?, remove any character from string x which is also us..

Answer / 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

Given two strings like x=?hello? and y=?open?, remove any character from string x which is also us..

Answer / bijoy kumar baral

Public abstract ClassDemo
{
public static void main(string args[]){
StringBuffer sb1= new stringBuffer("Hello");
StringBuffer sb2= new stringBuffer("open");
stringbuffer a= sb.deletecharacterAt("hello",1);
system.out.println("the value of a:"+a);
stringBuffer x=sb.deletecharacterAt("hllo"3);
system.out.println(x:+"x");
}

Is This Answer Correct ?    1 Yes 4 No

Given two strings like x=?hello? and y=?open?, remove any character from string x which is also us..

Answer / shilpa

x="hello", y="open"
so we have to remove e and o from x, so its hll

Is This Answer Correct ?    0 Yes 8 No

Post New Answer

More OOPS Interview Questions

In multiple inheritance , to create sub class object , is there need to create objects for its superclasses??? in java and c++ both. Actually i have some information that is , all available members from its superclasses , memory created in subclass obj , so no need to create object for its superclasses...??? Thanks in Advance

1 Answers  


what is inline function?

3 Answers  


What is a friend function & its advantage?

2 Answers   TCS,


Which language is not a true object oriented programming language?

0 Answers  


what is the difference between a package and a software?

3 Answers  


Petrol pump mgt. system: To design a program that display an interface for the sale of the Petrol and then make the entries at the backend in the database.

1 Answers   Wipro,


what is different between oops and c++

0 Answers   IIT,


Can we create object of interface?

0 Answers  


Describe these concepts: Polymorphism, Inheritance and Abstraction.

0 Answers   TCS,


write a programe to calculate the simple intrest and compund intrest using by function overlading

0 Answers  


What is the difference between the C & C++?

9 Answers   HCL,


Please tell me the oops concept with detailed answer

9 Answers   EEE,


Categories