容易出错 for 历遍 容易出错的 地方。 cannot find symbol ArrayIndexOutOfBoundsException

容易出错 for 历遍 容易出错的 地方。 cannot find symbol ArrayIndexOutOfBoundsException


出错的提示分别是:


error: cannot find symbol
		for( i=0;i

这是因为变量没有声明类型,所以系统会报错。 

容易出错 for 历遍 容易出错的 地方。 cannot find symbol ArrayIndexOutOfBoundsException



Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 3
	at HelloWorld.main(HelloWorld.java:11)

数组索引超出界限外面 

所以需要弄明白,hobbys.length的 含义,    数组的长度始终都比索引值要大1.所以 不能够有等于。 

容易出错 for 历遍 容易出错的 地方。 cannot find symbol ArrayIndexOutOfBoundsException