An sObject is a Salesforce-aware object representation in Apex — Account, Contact, Opportunity, MyCustom__c, etc. Apex generates an sObject class for every Salesforce object, with one strongly-typed field per Salesforce field.
apex Account acc = new Account(Name='Acme', Industry='Tech'); acc.Phone = '555-1234'; insert acc; System.debug(acc.Id); // populated after insert
You can also use the generic SObject superclass when you don't know the type at compile time:
apex SObject obj = Schema.getGlobalDescribe().get('Account').newSObject(); obj.put('Name', 'Acme'); insert obj;
This is useful in framework code that needs to work across many objects — e.g., a generic field-update utility.
Key methods:
obj.put('FieldName', value)/obj.get('FieldName')— generic accessors.obj.getSObjectType()— runtime type info.obj.fieldsToValue— map representation.
Lists of sObjects (List<Account>, List<SObject>) are the standard way to bulk-process records. SOQL queries return them naturally.
