编程知识 cdmana.com

"Java: variable may not have been initialized" reason:

1、if-else The statement is not written completely , The lack of else

 if(x>3)
 {
    y=2*x+1;
 }

To add else

  if(x>3)
 {
     y=2*x+1;
 }
 else
     y=2*x;

2、 Assignment not initialized , It just defines variables

版权声明
本文为[my future]所创,转载请带上原文链接,感谢
https://cdmana.com/2021/12/20211206042507298s.html

Scroll to Top