Here you can find the source of toChar(Object obj)
Parameter | Description |
---|---|
obj | the object to be converted |
public static char toChar(Object obj)
//package com.java2s; public class Main { /**/*from w ww .j av a2 s . c o m*/ * Get the char value of this object, only if the object is an instance of Character * * @param obj the object to be converted * @return the char value of the object, or '\u0000' if it is not a character. */ public static char toChar(Object obj) { return (obj instanceof Character) ? ((Character) obj).charValue() : '\u0000'; } }