How to Access all SObjects Via Apex?

March 16, 2018

Map SchemaMap = Schema.getGlobalDescribe();

System.debug(SchemaMap);

Set Sobjset = SchemaMap.KeySet();
List SobjList = new List (Sobjset);

SobjList.sort();

System.debug(SobjList);