{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Scala\n", "\n", "[Scala](https://www.scala-lang.org/) combines the functional/type-inference paradigm and the object-oriented paradigm, and is also meant to be an improved version of Java. Scala is the native language of [Apache Spark](Spark.ipynb).\n", "\n", "BeakerX has Scala APIs for [EasyForm](EasyForm.ipynb), [Tables](TableApi.ipynb), and [Plotting](Plot.ipynb)." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "class Greeter(prefix: String, suffix: String) {\n", " def greet(name: String): Unit =\n", " println(prefix + name + suffix)\n", "}" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "val greeter = new Greeter(\"Hello, \", \"!\")\n", "greeter.greet(\"Scala developer\") // Hello, Scala developer!" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "new Plot { title = \"Interactive Plots in Scala\"}.add(new Bars { y = Seq(3, 5, 2, 3, 7)})" ] } ], "metadata": { "beakerx_kernel_parameters": {}, "kernelspec": { "display_name": "Scala", "language": "scala", "name": "scala" }, "language_info": { "codemirror_mode": "text/x-scala", "file_extension": ".scala", "mimetype": "", "name": "Scala", "nbconverter_exporter": "", "version": "2.11.12" } }, "nbformat": 4, "nbformat_minor": 1 }