What is a valid statement about Apex classes and interfaces? - ProProfs Discuss
Cancel
TopicsDown
Products Down
Follow Us:
FacebookTwitter
Advertisement

What is a valid statement about Apex classes and interfaces?

A. The default modifier for a class is private.

B. Exception classes must end with the word exception.

C. A class can have multiple levels of inner classes.

D. The default modifier for an interface is private.

This question is part of salesforce platform developer 1
Asked by Hopeman, Last updated: Sep 24, 2020

+ Answer
Request
Question menu
Vote up Vote down 1

5 Answers

Liquad (Qingjun) Li

Liquad (Qingjun) Li

Write something about yourself

Liquad (Qingjun) Li
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.

upvote 2 downvote
Reply 

dprincloo

dprincloo

dprincloo
Dprincloo

Answered Jun 28, 2020

As Interface methods have no access modifiers and they are always global.Also The default modifier for a class is private. So correct answer narrows down to A and B

upvote downvote
Reply 

Joao Rosa

Joao Rosa

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.

upvote downvote
Reply 

philip82c

philipc

philip82c
Philipc

Answered Jan 04, 2019

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

upvote downvote
Reply 

cmduquer

cmduquer

cmduquer
Cmduquer

Answered Sep 28, 2018

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

####
upvote downvote 2
Reply 

Advertisement
Advertisement
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader

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