What is the purpose of the 'instanceof' operator in Java?
A. Check if an object is an instance of a class
B. Compare two objects
C. Check if a class is an instance of an object
D. Check if an object is null
'instanceof' is used to check if an object is an instance of a class.