Advertisement
n128

Tipos de datos

Mar 17th, 2019
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.60 KB | None | 0 0
  1. object App {
  2.     // En Scala todo es un objeto
  3.     /*
  4.         Any: es la raíz de tipos de scala
  5.             AnyVal: Int,
  6.                     Long,
  7.                     Double,
  8.                     Float,
  9.                     Byte,
  10.                     Short,
  11.                     Char,
  12.                     Boolean,
  13.                     Unit
  14.  
  15.             AnyRef: java.util.ArrayList
  16.     */
  17.  
  18.     // Int
  19.     5
  20.  
  21.     // Double
  22.     4.0
  23.  
  24.     // Float
  25.     6.0f
  26.  
  27.     // Byte
  28.     Byte
  29.     128
  30.  
  31.     // Short
  32.     Short
  33.     327667
  34.  
  35.     // Char
  36.     'c'
  37.  
  38.     // Boolean
  39.     true
  40.  
  41.     // Unit
  42.     Unit
  43.  
  44.     // Null: un AnyRef que no tiene valor
  45.     null
  46.  
  47.     // Nothing: tipo interno Scala. Es todo los tipos al mismo tiempo. Se utiliza para funciones que nunca "vuelven"
  48.     // Ex: bucles infinitos
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement