come in
所在版块:社会百科 发贴时间:2003-08-26 23:49  评分:

用户信息
复制本帖HTML代码
高亮: 今天贴 X 昨天贴 X 前天贴 X 
local variable are not implicitly initialised and use of non-initialised local variables just arise the complie error.

here when the program follow goes to tools.showMessage("Wrong entry.Try again."); y is not initialised, so there is a possibility that y is used as in tools.showMessage("The result is"+y); without initialising it.

the simplest way to solve is to change int y; to int y = 0;
.
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!

Put your OWN COOL signature here!
 相关帖子 我要回复↙ ↗回到正文
学长学姐帮忙看看-------- tonymmm   (504 bytes , 604reads )
come in 想念老乡   (396 bytes , 445reads )
oooooo, thank u very very much!!!:):):) tonymmm   (0 bytes , 252reads )