Chapter 1 - Building Blocks Flashcards

(4 cards)

1
Q

local type inference (var)

A

Only to be used as local variable.
Only to be used while declaring and initializing.
Can’t be used as constructor or method param.
Can not be used to declare multiple variables in one statement.
Type is inferred during compile time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

String text block
var text= “””
My name is
Venkatesh.”””

A

They start with “”” and end with “”” (3 double quotes)
Anything in between is literal and no need to escape except when it is “””
Learn about Incidental and essential white spaces.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Identifier name rules

A

Can contain letters and numbers and $ and _

It can not start with number
It can not have one letter which is _

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Is this true or false
var a=23, b=45;

A

False
Var can be used to assign and initialize only a single variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly