Changing a sprite in image canvas VIA C# script

A quick question, if I want to change the source image of an “Image” component through a script, how would I go about that? I am trying to access the source image property but I can’t figure out how.

//attach a sprite from inspector or instantiate at runtime using Resources.Load
public Sprite newSprite;

this.transform.getComponent<UnityEngine.UI.Image>().sprite = newSprite;

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Example: MonoBehaviour {

	public Image image;

	public  Sprite sprite;

	void Awake()
	{
		image.sprite = sprite;
	}

}