0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Scalaの記号のいろいろ

0
Last updated at Posted at 2021-04-01

はじめに

みなさんいかがお過ごしでしょうか
突然ですがScalaって簡潔に書けるとかいいいながら記号ばっかでわかりにくかったりしますよね....
こちらではそんなScalaでの記号のいろいろを紹介をしていきたいと思います。

環境

Scala

=

主に使われるのが代入
数学的な”=”ではない…
変数名 = 内容

変数

val  hoge = "hogehoge"

関数

代入とも言える

def 関数名 = 処理内容

:

型の定義

変数 : 型名

関数などの返り値

def 関数名(引数):返り値の型

::

配列など

=>

たくさんの意味をもつこの記号使い方も様々

関数の型表現

関数の引数の型と返り値の型を表現
引数の型 => 返り値の型

ラムダ式

引数 => コードブロック

パターンマッチ

case ケース => 処理

別ファイル名でインポート

ライブラリ名 => 別名

<-

forなど

_

引数わたしなど

(A,B)

タプル

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?