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
There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.
What is oops in simple words?
Why is it so that we can have virtual constructors but we cannot have virtual destructors?
What is multilevel inheritance explain with example?
What is oops?what is its use in software engineering?
Why do we need polymorphism in c#?
What is the point of oop?
What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?
What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?
Can you explain polymorphism?
What is abstraction with example?
What are the components of marker interface?
What is encapsulation in oop?
Can abstract class have normal methods?
write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.