Dhap Digital interview question

Why do we use Java in web-based applications?