File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
sources/net.sf.j2s.java.core/src/java/lang Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -330,4 +330,37 @@ public static int digit(int codePoint, int radix) {
330330 public static char [] toChars (int point ) {
331331 return null ;
332332 }
333+
334+ /**
335+ * Returns a <code>String</code> object representing this
336+ * <code>Character</code>'s value. The result is a string of
337+ * length 1 whose sole component is the primitive
338+ * <code>char</code> value represented by this
339+ * <code>Character</code> object.
340+ *
341+ * @return a string representation of this object.
342+ */
343+ public String toString () {
344+ char buf [] = {value };
345+ return String .valueOf (buf );
346+ }
347+
348+ /**
349+ * Returns a <code>String</code> object representing the
350+ * specified <code>char</code>. The result is a string of length
351+ * 1 consisting solely of the specified <code>char</code>.
352+ *
353+ * @param c the <code>char</code> to be converted
354+ * @return the string representation of the specified <code>char</code>
355+ * @since 1.4
356+ */
357+ public static String toString (char c ) {
358+ /**
359+ * @j2sNative
360+ * if (this == Charater) {
361+ * return "[Charater]";
362+ * }
363+ */ {}
364+ return String .valueOf (c );
365+ }
333366}
You can’t perform that action at this time.
0 commit comments