Account a = [SELECT Name FROM Account WHERE Name = ‘Foo’ LIMIT 1];String s = a.Name;// I can save it, but when I run the application I get another error.
// try –> String s =(String) a.Name;
String c = Account.Name;//second option I get the error “Illegal assignment from Schema.SObjectField to String”.
// try –> String c = (String)Account.Name;