Solution:
Change the Class name to resolve this issue.
Sample Code for this Exception:
Change the Class name to resolve this issue.
Sample Code for this Exception:
public class Contact {
public static List<Contact> contactlist(){
List<Contact> con = new List<Contact>();
con = [ SELECT Id, Email, Name FROM Contact LIMIT 5 ];
return con;
}
}
Exception:
Illegal assignment from List<Contact> to List<Contact>