Java examples for java.lang:String Format
get String from Object
//package com.java2s; public class Main { public static void main(String[] argv) { Object curObject = "java2s.com"; System.out.println(getString(curObject)); }//from www. j ava 2 s . c om public static String getString(Object curObject) { if (null == curObject) { throw new NullPointerException("The input object is null."); } else { return curObject.toString(); } } }