java中的toString() 方法(多看本文的例子!)
toString() 方法:
toString()方法在Object类中定义,其返回值是String类型,描述当前对象的有关信息
在进行String与其它类型数据的连接操作时,自动调用toString()方法
可以根据需要在用户自定义类型中重写toString()方法
基本类型数据转换为String类型时,调用了对应封装类的toString()方法
public class Person {
private String name;
private int age;
private char sex;
public Person()
{
}
public Person(String name,int age, char sex)
{
this.name = name;
this.age = age;
this.sex = sex;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public char getSex() {
return sex;
}
public void setSex(char sex) {
this.sex = sex;
}
public boolean equals(Object obj)
{
if(obj==null)
{
return false;
}
if(obj==this)//传递进来的参数是否等于本对象
{
 
相关文档:
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--每页显示记录条数
@currentpage int output,--第几页
@orderid nvarchar(50),--主键排序
@sort int,--排序方式,1表示升序,0表示降序排列
......
刚在本子上装了Windows 7 x64,然后装了64位的JRE,发现Eclipse和OO有些怪异的行为。具体而言就是程序无法正确结束:点窗口右上方的叉不好使了。点了后进程并没有结束,而只是在当前窗口和后台窗口之间切换。正在下32位的JRE,等装上看看结果。
看起来应该有两种方法解决:用32位的JRE或者换成64位的Eclipse和OO。
解决: ......
package cn.test;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
/**
* Java Reflection Cookbook
*
* @author Michael Lee
* @since 2006-8-23
* ......
platform ['plætfɔ:m] n.平台
standard edition标准版
enterprise ['entəpraiz] n. 企业
bytecode n.字节码,字节代码
verifier n. 检验机
modifier [‘mɔdifaiə] n.修饰语
attribute [‘ætribju:t] vt.(to)把…归因于n.属性,特性
declaration ......
FacesContext context = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest();
String parameterValue = request.g ......