The purpose of casting is to let the runtime and IDE know what type of object is returned by findViewById (R.id.order);
findViewById (R.id.order) does not return a specific type, but a generic object. Since Button contains methods related to the element referenced by the object, you need to specify its type so that the new orderButton variable has access to the correct methods.
This is a simple example.
http://www.java-samples.com/showtutorial.php?tutorialid=1170