Variable might not have been initialized error

前端 未结 11 1581
孤城傲影
孤城傲影 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 05:57

    Set variable "a" to some value like this,

    a=0;
    

    Declaring and initialzing are both different.

    Good Luck

提交回复
热议问题