Salesforce Wrapper Class Example

A quick search for Salesforce wrapper results in the following definition. A wrapper or container class is a class, a data structure, or an abstract data type whose instances are collections of other objects.

That's fine but if you're new to the concept then it is likely that the definition of a Salesforce wrapper class is not as useful as a practical example of the logic.

Let's say that you want to build a simple Visualforce page that will display a list of Contacts. For the page you will require a controller similar to the following:

/*
	Created by: Greg Hacic
	Last Update: 22 January 2015 by Greg Haci