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

if we don't write withsharing in class,then it will be withoutsharing right,then what is the use of writing withoutsharing again introduced in salesforce ?

Best Answer chosen by Ajju
Hi Ajju, 

Class is by default executed in System mode means which does not consider User Level Sharing. 

To Override that we use With Sharing keyword to override the default sharing execution. 

See the doc below,

And there are few other components which execute in User mode by default to override those classes we use Without Sharing keywords.