I have creates a List of contacts in Salesforce UI and also created related tasks such as activity logs on those contact. Now I want to know how to fetch all the tasks related to those contacts. I have tried the following using execute anonymous in developer console:
List<Contact> conList = [SELECT Id From Contact limit 5];
System.debug('--Task details with id ---' + conList);
But this doesn't show me the task objects, Please help me out on finding how to query out those tasks and their fields in apex code.