Will the following code compile successfully?
 
private int GetID (string inputText) 
{
    if (inputText != "")
         return 1;
  else if (inputText == "")
        return 0;

 }
 
Explanation
Even though it may seem that all the options are considered, it is necessary that there is either an unconditional return at the end of the method or an else block inside of a nested if block. It turns out that formally not all the blocks are present in given code (although all of them are considered logically).

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести