Your preferences have been saved!
» Check if a text is present at the current position - import java.io.File; import java.io.FileFilter; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; public class Main {   /**    * Check if a text is present at the current position in a buffer.... 17 Feb 12 » Demonstrates the transient keyword - import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.Date; public class Logon implements Serializable {   private Date date = new Date();   private String username;   private transient String password;... 17 Feb 12 » Gets the toString that would be produced by Object if - import java.io.Serializable; /**  * <p>Operations on <code>Object</code>.</p>  *   * <p>This class tries to handle <code>null</code> input gracefully.  * An exception will generally not be thrown for a <code>null</code> input.  * Each method documents its behaviour in more detail.</p>  *  * @author <a href="mailto:nissim@nksystems.com">Nissim Karpenstein</a>  * @author <a href="mailto:janekdb@yahoo.co.uk">Janek Bogucki</a>... 17 Feb 12 » Gets the toString of an Object returning an empty string - import java.io.Serializable; /**  * <p>Operations on <code>Object</code>.</p>  *   * <p>This class tries to handle <code>null</code> input gracefully.  * An exception will generally not be thrown for a <code>null</code> input.  * Each method documents its behaviour in more detail.</p>  *  * @author <a href="mailto:nissim@nksystems.com">Nissim Karpenstein</a>  * @author <a href="mailto:janekdb@yahoo.co.uk">Janek Bogucki</a>... 17 Feb 12 » Array To String - import java.io.PrintWriter; import java.io.StringWriter; import java.net.InetAddress; import java.net.URI; import java.net.URISyntaxException; import java.net.UnknownHostException; import java.text.DateFormat; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Arrays;... 17 Feb 12 » toString(Object[] array) - /**  * @version $Revision: 1.1 $  */ public final class ToString {     public static String toString(Object[] array)     {         StringBuffer buffer = new StringBuffer();         Class type = array.getClass().getComponentType();         if (type != Object.class)... 17 Feb 12 » Null Safe To String - import java.lang.reflect.Array; import java.util.Arrays; abstract class ObjectUtils {   private static final int INITIAL_HASH = 7;   private static final int MULTIPLIER = 31;   private static final String EMPTY_STRING = "";   private static final String NULL_STRING = "null";   private static final String ARRAY_START = "{";   private static final String ARRAY_END = "}";   private static final String EMPTY_ARRAY = ARRAY_START + ARRAY_END;... 17 Feb 12 » Constructs pretty string representation of object value - import java.lang.reflect.Array; import java.util.Collection; import java.util.Iterator; import java.util.Map; /**  * Constructs pretty string representation of object value.  */ public class PrettyStringBuilder {   protected int maxArrayLen = 10;   protected int maxDeep = 3;... 17 Feb 12 » Use a generic toString() - import java.lang.reflect.Field; public class Main {   public static void main(String args[]) {     System.out.println(new MyClass().toString());   } } class MyClass {   String hello = "hi";   int i = 0;   public String toString() {... 17 Feb 12 » Reflection based toString() utilities - import java.lang.reflect.Field; public class Main {   String hello = "world";   int i = 42;   public static void main(String args[]) {     System.out.println(Util.toString(new MyClass()));          System.out.println(Util.toString(new MyAnotherClass()));   } }... 17 Feb 12