Language Flashcards
Everything is an ___ (can call member functions and properties on any variable)
object
___, ___, and ___ are represented as primitives at runtime
numbers; characters; booleans
What are the 4 types of integers
Byte, Short, Int, Long
___ or ___ is chosen based on the initial value given to an integer literal
Int, Long
You can specify Long by adding the ___ suffix
L
How do floating-point types differ from one another?
By how many decimals they can store
Variables initialized with fractional numbers are inferred to be of type ___
Double
You can specify Float with the ___ suffix
F or f
What happens if the initial value of a Float contains more than 6-7 decimal digits?
It will be rounded
Does Kotlin support implicit widening conversions for numbers?
No
How do you convert numeric values to different types?
By using Explicit Conversion functions
What are the 4 types of literal constants?
Decimals, Longs, Hexadecimals, and Binaries
You can use ___ in numeric literals.
Underscores
Numbers are stored as ___ unless ___ or ___ are involved.
JVM primitives; nullable; generics
Boxing of numbers doesn’t always preserve ___.
identity
Smaller numeric types are not ___ of bigger types, and therefore aren’t ___ ___ to bigger types.
sub-types; implicitly; converted
What are the 7 explicit conversion functions?
toByte(); toShort(); toInt(); toLong(); toFloat(); toDouble(); toChar()
Bitwise functions are ___ functions that can be called in ___ form.
named; infix
What are the 7 infix bitwise functions?
signed shift left (shl); signed shift right (shr); unsigned shift right (ushr); bitwise and (and); bitwise or (or); bitwise xor (xor); bitwise inversion (inv)
When operands are ___ ___ as floating-point numbers they follow the ___ for ___-___ arithmetic.
statically typed; standard; floating-point
When operands aren’t statically typed as floating-point numbers, operations use ___ and ___.
equals(); compareTo()
Characters can’t be directly treated as ___.
numbers
Characters have 10 types of ___ ___.
escape sequences
Booleans and Characters are ___ if a nullable reference is needed.
boxed
Arrays have ___ and ___ functions that turn into [] by operator overloading.
get; set
What are the 3 ways to create an Array?
arrayOf(); arrayOfNulls(); Array constructor
Arrays are ___.
invariant
Primitive type arrays provide arrays of primitive types without ___ ___.
boxing overhead
Primitive type arrays have no ___ relationship to Array class.
inheritance
Primitive type arrays have the same set of ___ and ___ as the Array class.
methods; properties