import java.util.Formatter;
public class MainClass{
public static void main(String[] argv){
StringBuilder sb = new StringBuilder();
Formatter f = new Formatter(sb);
MyClass b = new MyClass();
f.format("The value is %b, so there.", b);
System.out.println(sb);
}
}
class MyClass{
public String toString(){
return "MyClass";
}
}
|