Get the current User ID in an Apex

 How can we get current logged in user id without using SOQL query in apex?

Answer

String userId = UserInfo.getUserId();
System.debug('userId: '+userId); 
Labels:
Join the conversation