What is the primary difference between Scala and Java in terms of syntax?
Scala has a more concise syntax than Java, but it still uses Java-style classes and objects.
Thatâ€™s partially correct. Scala does have a concise syntax, but it also introduces features like pattern matching and immutability that Java doesn't directly support.
Can you explain how Scala's type inference works and how it compares to Java's explicit type declaration?