Hello friends, In this post you will find a code sample that helps you to get field type of particular field from any salesforce object. So let's get started,

Get salesforce object field type in apex

In this sample code, I am picked up industry field from account object. You can pick any field from any sobject as per your need.

Sample Code:

 String objectName = 'Account';
String fieldName = 'Industry';
Schema.DisplayType ftype = Schema.getGlobalDescribe().get(objectName).getDescribe().fields.getMap().get(fieldName).getDescribe().getType();
System.debug('ftype^^ '+ftype);

Output:

Hope you like this post, for any feedback or suggestions please feel free to comment. I would appreciate your feedback and suggestions.
Thank you.