InterviewSolution
| 1. |
What is Scala |
|
Answer» Scala, originally a general-purpose programming language, has RISEN to prominence in today's Big Data industry. It is because of its high LEVEL of scalability and ability to handle petabytes of data. Object-oriented and functional programming are both possible with Scala, and Scala is a language that can run on the Java Virtual Machine (JVM). This makes Scala a great choice for developing websites. It has grown to be one of the most beloved programming languages of developers because of its VAST array of libraries. Using Scala, Spark developers can write better, more performant code through powerful features like macros, tuples, and functions. Although Scala is difficult to master to some extent, the effort and money put into learning the language are well worth it. Example 1: Object-oriented APPROACH object ScalaProgram{ def main(args:Array[String]) { println("Welcome to InterviewBit") } }Output: Welcome to InterviewBitA functional approach can also be used to write code in Scala, as shown below: Example 2: Functional Approach def scalaProgram { println("Welcome to InterviewBit") } scalaProgramOutput: Welcome to InterviewBit |
|