A is correct.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_static.htm
A class static variable can’t be accessed through an instance of that class. If class MyClass has a static variable myStaticVariable, and myClassInstance is an instance of MyClass, myClassInstance.myStaticVariable isn’t a legal expression.
the answer is D not A. You are instantiating a reference to the class InsuranceRates as 'rates', which has a static variable named smokerCharge which is accessible outside of that class. As such, it would be rates.smokerCharge
A - Correct
A class static variable can’t be accessed through an instance of that class. If class MyClass has a static variable myStaticVariable, and myClassInstance is an instance of MyClass, myClassInstance.myStaticVariable isn’t a legal expression.
A is correct. verified it in the dev console. Option D won't even save, you will get the error "Static field cannot be referenced from a non static context: smokerCharge from the type InsuranceRates"
Just tried the code in dev console. A is the correct answer.
upvoted 5 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Abhishek36s
Highly Voted 2Â years, 5Â months agoNEWBIEGUY
Highly Voted 2Â years, 9Â months agokhoce
2Â years, 6Â months agoAnkit_Swami
Most Recent 4Â months, 2Â weeks agoSS1121
4Â months, 3Â weeks agoABHI0O07
7Â months, 3Â weeks ago1vanTT
1Â year, 6Â months agosmoota
1Â year, 9Â months agoNand072
1Â year, 3Â months agoOldscool8
7Â months, 3Â weeks agoTherrudy1994
2Â years, 6Â months ago