Salesforce Interview questions with answers Part 19

1. Does Apex supports Generics?

Apex partially supports Generic programming.

For more info, visit the below link

2. Can we write any Apex code in Configuration Only Sandbox?


3. How to render Visualforce Page as Excel?

<apex:page controller="ExportAsCSV" action="{!exportToCSV}" cache="true" contentType="application/" language="en-US">

4. What is the advantage of writing the Test classes from the same class and from the other classes?

Easy to move to other environments.
Easy to maintain for code modification.

This is not supported in recent API versions of Apex Classes.

5. With Data loader using "Upsert" operation performed over 10 records which includes 3 records as ABC,ABC,ABC. Will it throw any error?

Yes it will throw duplicate external ids found error.