
1.Create a class named BuilderDemo. Use the string builder method to get the following output from string s4 Consider: String s4 = â??Java is an OO â?? Output : language OO na not si avaJ ???
Consider: String s5 = â?? Todays Date is = â?? Output : Todays Date = 7/3/2011

import java.util.*;
class BuilderDemo{
public static void main(String[] args)
{
String st="Java is an OO";
String str[]=st.split("");
String reversedSt="";
for(int i=str.length-1;i>=0;i--){
reversedSt+=str[i];
}
StringBuilder builder=new StringBuilder(reversedSt);
builder.insert(0, "language ").insert(15,"not ");
System.out.println(builder.toString());
}
}
import java.util.*;
class BuilderDemo{
public static void main(String[] args)
{
String st="Todays Date is =";
StringBuilder builder=new StringBuilder(st);
String str="7/3/2011";
builder.insert(16, str);
System.out.println(builder.toString());
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.