add java solution for ReverseAndAdd