I am trying to sort the max in lists using this recursion. Unsure why I am getting a class cast exception when trying to call maxOf2.
You have many spacing errors, which is probably the problem. Also, too many extra parenthesis like (maxOf2(firstVal ...
should probably be:
(maxOf2 firstVal (listMax (rest aList))) ; ***** notice spacing! *****
Please also consult this list of documentation for more resources.