String comparison (equals, compareTo)
📖 Scenario: You are creating a simple program to compare two names to see if they are the same or which one comes first in alphabetical order.
🎯 Goal: Build a Kotlin program that compares two strings using equals and compareTo methods and shows the results.
📋 What You'll Learn
Create two string variables with exact names and values
Create a boolean variable to store the result of equals comparison
Use compareTo to find the alphabetical order difference
Print the results exactly as instructed
💡 Why This Matters
🌍 Real World
String comparison is useful in sorting names, searching text, and validating user input in many apps.
💼 Career
Understanding string comparison helps in writing code for data processing, user authentication, and UI sorting features.
Progress0 / 4 steps