Java toString() method
来源:互联网 发布:论文表格数据来源 编辑:程序博客网 时间:2024/06/07 03:05
Java toString() method
If you want to represent any object as a string, toString() method comes into existence.
The toString() method returns the string representation of the object.
If you print any object, java compiler internally invokes the toString() method on the object. So overriding the toString() method, returns the desired output, it can be the state of an object etc. depends on your implementation.
Advantage of Java toString() method
By overriding the toString() method of the Object class, we can return values of the object, so we don't need to write much code.
Understanding problem without toString() method
Let's see the simple code that prints reference.
Output:Student@1fee6fc Student@1eed786
Example of Java toString() method
Now let's see the real example of toString() method.
0 0
- Java toString() method
- DateTime.ToString Method (String)
- Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object
- Java.toString()
- java.toString
- Java toString
- java--toString
- Java toString
- java toString()
- java-toString
- jQuery - 参考资料 - toString Method (JScript 5.6):
- Java tostring()方法
- (java)关于toString()
- java toString()用法
- java toString方法作用
- java.toString() ,(String),valueOf
- java.toString() ,(String),valueOf
- Java中覆盖toString()
- OpenCV学习笔记(20)Kinect + OpenNI + OpenCV + OpenGL 组合体验
- 二叉树
- 如何用Fabric实现无密码输入提示的远程自动部署
- 【跟我学spring 4.0 】之第六节-spring中scope作用域
- ListView的复用->购物车,listView的布局复用->聊天窗口
- Java toString() method
- android中的category(调用系统工具等)
- 一种我喜欢的vim的配置
- Maven3 项目创建设置
- CheckedTextView
- android应用安装成功之后删除apk文件
- 在hibernate启动的时候报了个错: 对实体 "characterEncoding" 的引用必须以 ';' 分隔符结尾
- 生命是一个长期而持续的积累过程
- 一些话语