他是说你没有初始化而已,一般只是个warning,如果是在不能跑,那就给他初始化一下. 注意,初始化可不是任意值哈! 就比如如果要算阶乘,你初始化就不能为0. 还有如果是比较大小这类,就不要把初始化统一写成0或1,就赋值成你要比较的第一个值就行.
他是说你没有初始化而已,一般只是个warning,如果是在不能跑,那就给他初始化一下. 注意,初始化可不是任意值哈! 就比如如果要算阶乘,你初始化就不能为0. 还有如果是比较大小这类,就不要把初始化统一写成0或1,就赋值成你要比较的第一个值就行.
variableansmightnothavebeeninitialized报错,以及初始化注意 点 他是说你没有初始化⽽已,⼀般只是个warning,如果是在不能跑,那就给他初始化⼀下.注意,初始化可不是任意值哈!就⽐如如果要算阶乘,你初始化就不能为0.还有如果是⽐较⼤⼩这类,就不要把初始化统⼀写成0或1,就赋值成你要...
variable 'y' might not have been initialized 这个不是错误,是一个警告,也就是说编译器告诉你:Y变量可能没有初使化。可以照常编译通过并执行的。但一般来说,看到警告你自己检查一下代码,比如这儿,如果Y没有初使化,会不会使程序出现执行方面的逻辑错误。
在前面需要初始化这个变量 int position_before = 0, position_after = 0, smallVowel = 0, largeVowel = 0;建议你用eclipse来写java代码,这样出错的时候IDE会自动提示,一目了然
你好,很高兴为你解答 Variable fs' might not have been initialized 变量FS可能未初始化 局部变量不经初始化无法使用。也许是编译器认为循环中的赋值操作可能无法执行,所以才报错的。在方法里就定义直接初始化为任何数,或者干脆做成一个类变量,系统就自己给初始化了。
public class firm { String sDBDrive ="sun.jdbc.odbc.JdbcOdbcDrive";String sConnStr="jdbc:odbc:firm";private Connection conn=null;private Statement stmt=null;ResultSet rs=null;public firm(){ try { Class.forName(sDBDrive);} catch (java.lang.ClassNotFoundException e){ System.err....
This is exactly the same code which the teacher in the lesson video got and it works by him but I get error: Variable randomNumber might not have been initialized and when I put randomNumber in the "Toaster" and run the app is crash. Do someone know the solution? I found answers w...
Rand.java:72: variable a might not have been initialized a++ ; ^ Rand.java:74: variable b might not have been initialized b++ ; ^ 2 errors It seems to me that I initialized them at the top of the method. What's going wrong? java variables initialization Share Improve this questio...
If you are getting the "variable might not have been initialized" error in Java, it means that you are trying to use a local variable that has not been assigned a value.