Create a code snippet to sort a given array of strings in descending order based on their lengths in Python.
arr = ["Python", "Javascript", "Ruby", "Java"]
arr.sort(key=lambda x: len(x), reverse=True)
print(arr)