Skip to main content

While doing the challenge this error is coming, I am not sure what to do. Can someone please help ?

 

This is the error :

We can’t find the correct results format. Make sure that your concatenation puts each list item in this format: 'Account Name' : 'Annual Revenue'.

 

The code :

public class AccountUtility

{

public static void viewAnnualRevenue()

{

List<Account> accountsList=[SELECT Name, AnnualRevenue from Account];

for(Account act: accountsList)

{

String accRev=act.Name+' : '+act.AnnualRevenue;

System.debug(accRev);

}

}

}

3 réponses
  1. 30 mars 2022, 15:16

    Hi Pratik,

    The challenge says that the concatenated string should be stored in a value named: acctRev

     

    Your code seems to be missing the t for the variable name, try fixing that.