Write code to get String from Object, handle null value with conditional operator
//package com.book2s; public class Main { public static void main(String[] argv) { Object value = "book2s.com"; System.out.println(getString(value)); }//from w w w .j a va 2 s. c o m /** * */ public static String getString(Object value) { return value == null ? null : value.toString(); } }