Variable might not have been initialized error

前端 未结 11 1579
孤城傲影
孤城傲影 2020-11-21 05:50

When i try to compile this:

public static Rand searchCount (int[] x) 
{
    int a ; 
    int b ; 

    ...   

    for (int l= 0; l

        
11条回答
  •  渐次进展
    2020-11-21 06:20

    You declared them, but didn't initialize them with a value. Add something like this :

    int a = 0;
    

提交回复
热议问题