Account ac = [SELECT Id, Name FROM Account WHERE Name = 'Bank of America']; ac.Name='Discover'; update ac;
Solution 1 (Recommended):
Solution 2: