how to get the api name of all object in apex class code example
Example 1: apex get object describe by api name
SObjectType objectType = Schema.getGlobalDescribe().get('<Object API Name>');
Schema.DescribeSObjectResult objectDescribe = objectType.getDescribe();
Example 2: apex get object fields by api name
SObjectType objectType = Schema.getGlobalDescribe().get('<Object API Name>');
Map<String,Schema.SObjectField> fieldMap = objectType.getDescribe().fields.getMap();