What is a valid statement about Apex classes and interfaces? - ProProfs Discuss
Topics
Products
Follow Us:

What is a valid statement about Apex classes and interfaces?

This question is part of Salesforce Platform Developer 1
Asked by Hopeman, Last updated: Jan 15, 2020

+ Answer
Request
1

4 Answers

Liquad (Qingjun) Li

Write something about yourself

Liquad (Qingjun) Li, Software Engineer, Enter your education, Shanghai, China

Answered Oct 17, 2018

Answer: A, B

Description:

A.The default modifier for a class is private.

The top-level of the type must set Public or Global for the modifier. So an only inner class can ignore to set, which default to private.

C is incorrect. Because aclassonly can have 1levels of inner class.

D is incorrect. Interface is atop level of type, that must set Public or Global for modifier. No inner interface so no default modifier for interface.

2
 

Joao Rosa

Joao Rosa

Answered Sep 08, 2019

Private

This is the default, and means that the method or variable is accessible only within the Apex class in which it is defined. If you do not specify an access modifier, the method or variable is private.

Interface methods have no access modifiers. They are always global. For more information, seeInterfaces.

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_access_modifiers.htm

 

philipc

Philipc

Answered Jan 04, 2019

This question is incorrect - the only correct answer here is B

 

cmduquer

Cmduquer

Answered Sep 28, 2018

Exception classes must end with the word exception.
The default modifier for an interface is private.

####
2
 

Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer

Email Sent
We have sent an email to your address "" with instructions to reset your password.