Java toString() 方法

Java 教程 · 2019-02-08 18:42:39

toString() 方法用于返回一个表示指定 char 值的 String 对象。结果是长度为 1 的字符串,仅由指定的 char 组成。

语法

String toString(char ch)

参数

  • ch -- 要转换的字符。

返回值

返回指定 char 值的字符串表示形式。

实例

public class Test {

    public static void main(String args[]) {
        System.out.println(Character.toString('a'));
        System.out.println(Character.toString('A'));
    }
}

以上程序执行结果为:

a
A

点击查看所有 Java 教程 文章: https://www.codercto.com/courses/l/12.html

查看所有标签

A Guide to Monte Carlo Simulations in Statistical Physics

A Guide to Monte Carlo Simulations in Statistical Physics

Landau, David P./ Binder, Kurt / Cambridge Univ Pr / 2005-9 / 786.00元

This new and updated edition deals with all aspects of Monte Carlo simulation of complex physical systems encountered in condensed-matter physics, statistical mechanics, and related fields. After brie......一起来看看 《A Guide to Monte Carlo Simulations in Statistical Physics》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

html转js在线工具
html转js在线工具

html转js在线工具