数据类型的几个小问题

  1. 有没有好的输入法能支持驼峰式命名? 也就是说能够方便的输入"toStringOrOther"这样的字符串,而不用去按那个shift键.
  2. String类型是否有长度限制?
  3. 有了数据类型int,还定义一个Integer对象类型干啥?有啥用?

[color=blue][b]1、没用过,应该没有。要不然那种输入法早就流行了

2、String有长度限制。String其实是一个char数组,数组的长度用int计数。[/b][/color]

[code="java"]
public final class String
implements java.io.Serializable, Comparable, CharSequence
{
/** The value is used for character storage. */
private final char value[];

/** The offset is the first index of the storage that is used. */
private final int offset;

/** The count is the number of characters in the String. */
private final int count;

//........
[/code]
[color=blue][b]
String的最大长度,就是整形的最大值(因为count是int的)

3、int是原生数据类型。不是一个类。你在Java类的 结构图中找不到int。Integer是一个类,继承Number,而Number继承Object。所以Integer是一个类,int不是类。

因此以下语句,无法通过编译!![/b][/color]
[code="java"]
int i= 0;
if(i!= null){
//......
}
[/code]

异想天开,输入法是为字体而存在的,不是为了你方便就开发的,而且驼峰式命名是根据个人的开发单词所定义,怎么可能会有一种输入法来规定啊