function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
PlatFormCloudPlatFormCloud 

Constructor and Debug Log

Can we able to see the debug ststement if we write System.Debug within a Constructor?
MandyKoolMandyKool
Why not. You can.
Amit Chaudhary 8Amit Chaudhary 8
Yes you can...
Please check below post for more information
1) https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_debugging_debug_log.htm
2) http://salesforce.stackexchange.com/questions/36582/how-do-i-start-to-debug-my-own-apex-code
3) http://www.sfdc99.com/2014/02/22/debug-your-code-with-system-debug/

Sample code for you
public class DemoClass
{
   public DemoClass()
   {
         System.debug('-------Hello---------->');
   }
}
How to execute above code from developer console
DemoClass obj = new DemoClass();




Please let us know if this will help you.