What is the difference between public and global class in apex?



What is the difference between public and global class in apex?..

Answer / Om Prakash

"In Apex (a programming language used by Salesforce), both public and global classes are accessible from anywhere. However, the main difference lies in visibility within the code itself:n- A global class can contain static variables and methods that are shared across all instances of the class.n- A public class can only contain instance variables and methods specific to each instance."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Salesforce Interview Questions

If an action is scheduled to be executed for a time-based workflow, is it possible to delete the workflow?

1 Answers  


When should we use component event and application events?

1 Answers  


How to call java script using static resource in visual force page?

1 Answers  


what all the services that salesforce supports?

1 Answers   Cap Gemini,


What is the difference between database.insert and insert?

1 Answers  


There is a master-detail relationship between two objects and I want to ensure that the master object should not have more than 10 child records. How

1 Answers  


Can we use pagereference in lightning component? : salesforce lightning component

1 Answers  


Explain Casting in salesforce?

1 Answers  


How do you call an API in Salesforce?

1 Answers  


What are action support, action function and action poller used for?

1 Answers  


What are the advantages of lightning ? : salesforce lightning component

1 Answers  


What are different kinds of dashboard component?

1 Answers  


Categories