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
Smart FellowSmart Fellow 

Dear team of Community, I want to learn how to write a code in Apex using With sharing and Without sharing ?

Sample Example please
Sandeep YadavSandeep Yadav
Hi smart fellow,
it's very simple.
Use with sharing keyword when you want to write a class using with sharing
Here is simple syntax for both methods--

public with sharing class ClassName{
      //your awesome logic goes here
}
public class ClassName{
    //your awesome logic goes here
}