Uncover your misconceptions by answering conceptual questions
Conceptual Self-Check
Answer 247 Concept Questions
In Java:
An abstract class does not need to implement all abstract methods defined in its superclass
An abstract class does not need to implement all abstract methods defined in its superclass
I am not sure what's right.
In Java:
An abstract class must implement all abstract methods defined in its superclass
An abstract class must implement all abstract methods defined in its superclass
In Java:
An abstract class cannot contain implemented methods
An abstract class cannot contain implemented methods
I am not sure what's right.
In Java:
An abstract class can also contain implemented methods
An abstract class can also contain implemented methods
In Java:
Set of class members stays fixed at runtime
Set of class members stays fixed at runtime
I am not sure what's right.
In Java:
Set of class members can change at runtime
Set of class members can change at runtime
In Java:
Only classes without constructor automatically get a no-argument constructor
Only classes without constructor automatically get a no-argument constructor
I am not sure what's right.
In Java:
All classes automatically get a no-argument constructor
All classes automatically get a no-argument constructor
In Java:
Any class can be an exception class
Any class can be an exception class
I am not sure what's right.
In Java:
Exceptions are subtypes of Throwable
Exceptions are subtypes of Throwable
In Java:
Addition and string concatenation have same precedence
Addition and string concatenation have same precedence
I am not sure what's right.
In Java:
Addition has higher precedence than string concatenation
Addition has higher precedence than string concatenation
In Java:
Square brackets are used to access an element in an array
Square brackets are used to access an element in an array
I am not sure what's right.
In Java:
Parentheses are used to access an element in an array
Parentheses are used to access an element in an array
In Java:
Arrays are created without the new keyword
Arrays are created without the new keyword
I am not sure what's right.
In Java:
All arrays are allocated on the heap with new
All arrays are allocated on the heap with new
In Java:
The number of brackets in an array type or an array initializer corresponds to the length of the array
The number of brackets in an array type or an array initializer corresponds to the length of the array
I am not sure what's right.
In Java:
The number of brackets in an array type or an array initializer corresponds to the rank of the array
The number of brackets in an array type or an array initializer corresponds to the rank of the array
In Java:
The type of a multi-dimensional array is written as T[][][]
The type of a multi-dimensional array is written as T[][][]
I am not sure what's right.
In Java:
The type of a multi-dimensional array is written as T[] T[] T[]
The type of a multi-dimensional array is written as T[] T[] T[]
In Java:
Elements of arrays are untyped
Elements of arrays are untyped
I am not sure what's right.
In Java:
The type of an array specifies the type of the elements
The type of an array specifies the type of the elements
In Java:
To get the length of an array, one needs to read its length field
To get the length of an array, one needs to read its length field
I am not sure what's right.
In Java:
To get the length of an array, one needs to call its length method
To get the length of an array, one needs to call its length method
In Java:
Array initializers list the elements in curly braces
Array initializers list the elements in curly braces
I am not sure what's right.
In Java:
Array initializers list the elements in square brackets
Array initializers list the elements in square brackets
In Java:
An array can have a length of 0 elements
An array can have a length of 0 elements
I am not sure what's right.
In Java:
An array cannot have a length of 0 elements
An array cannot have a length of 0 elements
In Java:
The length of an array is not part of its type
The length of an array is not part of its type
I am not sure what's right.
In Java:
The length of an array is part of its type
The length of an array is part of its type
In Java:
ArrayLists are arrays
ArrayLists are arrays
I am not sure what's right.
In Java:
ArrayLists and arrays are different things
ArrayLists and arrays are different things
In Java:
Array rank and array length are the same thing
Array rank and array length are the same thing
I am not sure what's right.
In Java:
Array rank and array length are different concepts
Array rank and array length are different concepts
In Java:
The rank of an array is part of its type
The rank of an array is part of its type
I am not sure what's right.
In Java:
The rank of an array is not part of its type
The rank of an array is not part of its type
In Java:
The length of an array is fixed and is determined at allocation
The length of an array is fixed and is determined at allocation
I am not sure what's right.
In Java:
Arrays can grow dynamically
Arrays can grow dynamically
In Java:
= compares two values
= compares two values
I am not sure what's right.
In Java:
= assigns a value to a variable
= assigns a value to a variable
In Java:
Assignment copies the object
Assignment copies the object
I am not sure what's right.
In Java:
Assignment copies the reference pointing to the object
Assignment copies the reference pointing to the object
In Java:
An assignment a=b is not an expression
An assignment a=b is not an expression
I am not sure what's right.
In Java:
An assignment a=b is an expression and thus produces a value
An assignment a=b is an expression and thus produces a value
In Java:
Recursive computations need a base case to terminate
Recursive computations need a base case to terminate
I am not sure what's right.
In Java:
Recursive computations do not necessarily need a base case
Recursive computations do not necessarily need a base case
In Java:
The base case of a structural recursion does not perform a recursive call
The base case of a structural recursion does not perform a recursive call
I am not sure what's right.
In Java:
The base case of a structural recursion consists of a recursive self-call
The base case of a structural recursion consists of a recursive self-call
In Java:
A method invocation on a reference of a type that does not have that method won't compile
A method invocation on a reference of a type that does not have that method won't compile
I am not sure what's right.
In Java:
A method invocation on a reference of a type that does not have that method will compile
A method invocation on a reference of a type that does not have that method will compile
In Java:
One cannot invoke methods on primitive values
One cannot invoke methods on primitive values
I am not sure what's right.
In Java:
One can invoke a method on primitive values
One can invoke a method on primitive values
In Java:
One needs a variable to invoke a method
One needs a variable to invoke a method
I am not sure what's right.
In Java:
Methods can be invoked on expressions that evaluate to a suitable object
Methods can be invoked on expressions that evaluate to a suitable object
In Java:
Each method invocation allocates a new stack frame
Each method invocation allocates a new stack frame
I am not sure what's right.
In Java:
A method invocation does not necessarily allocate a stack frame
A method invocation does not necessarily allocate a stack frame
In Java:
Stack frame of caller does not include variables for callee's formal parameters
Stack frame of caller does not include variables for callee's formal parameters
I am not sure what's right.
In Java:
Stack frame of caller includes variables for callee's formal parameters
Stack frame of caller includes variables for callee's formal parameters
In Java:
Member accesses can be chained together
Member accesses can be chained together
I am not sure what's right.
In Java:
Member accesses cannot be chained together
Member accesses cannot be chained together
In Java:
Method calls or field accesses can be chained to a constructor invocation
Method calls or field accesses can be chained to a constructor invocation
I am not sure what's right.
In Java:
Method calls or field accesses cannot be chained to a constructor invocation
Method calls or field accesses cannot be chained to a constructor invocation
In Java:
Catch blocks only get executed if an exception is thrown in the try block
Catch blocks only get executed if an exception is thrown in the try block
I am not sure what's right.
In Java:
Catch blocks always get executed
Catch blocks always get executed
In Java:
Only the part of a catch block necessary to fix the cause of an exception is executed
Only the part of a catch block necessary to fix the cause of an exception is executed
I am not sure what's right.
In Java:
When an exception is caught, all statements in the corresponding catch block execute
When an exception is caught, all statements in the corresponding catch block execute
In Java:
Chained methods are called on the object that results from the previous call in the chain
Chained methods are called on the object that results from the previous call in the chain
I am not sure what's right.
In Java:
Chained methods are all called on the object at the beginning of the chain
Chained methods are all called on the object at the beginning of the chain
In Java:
Char is a numeric type
Char is a numeric type
I am not sure what's right.
In Java:
Char is not a numeric type
Char is not a numeric type
In Java:
To test whether an expression is true or false, one can just use it
To test whether an expression is true or false, one can just use it
I am not sure what's right.
In Java:
To test whether an expression is true or false, one must compare it to true or to false
To test whether an expression is true or false, one must compare it to true or to false
In Java:
Expressions that consist of multiple parts have no type
Expressions that consist of multiple parts have no type
I am not sure what's right.
In Java:
Expressions that consist of multiple parts have a type
Expressions that consist of multiple parts have a type
In Java:
A concrete class needs to implement all abstract methods and override all concrete methods declared in its abstract superclasses
A concrete class needs to implement all abstract methods and override all concrete methods declared in its abstract superclasses
I am not sure what's right.
In Java:
A concrete class does not necessarily need to override concrete methods declared in its abstract superclasses
A concrete class does not necessarily need to override concrete methods declared in its abstract superclasses
In Java:
A concrete class only needs to implement those abstract methods it inherits from abstract superclasses
A concrete class only needs to implement those abstract methods it inherits from abstract superclasses
I am not sure what's right.
In Java:
A concrete class needs to implement both the abstract methods it inherits from abstract superclasses and those declared in the interfaces it implements
A concrete class needs to implement both the abstract methods it inherits from abstract superclasses and those declared in the interfaces it implements
In Java:
A concrete class needs to implement all abstract methods declared in its supertypes, both direct and indirect
A concrete class needs to implement all abstract methods declared in its supertypes, both direct and indirect
I am not sure what's right.
In Java:
A concrete class only needs to implement abstract methods declared in its direct supertypes
A concrete class only needs to implement abstract methods declared in its direct supertypes
In Java:
A concrete class needs to implement both the abstract methods it inherits from interfaces and those declared in the abstract class it extends
A concrete class needs to implement both the abstract methods it inherits from interfaces and those declared in the abstract class it extends
I am not sure what's right.
In Java:
A concrete class only needs to implement those abstract methods it inherits from interfaces
A concrete class only needs to implement those abstract methods it inherits from interfaces
In Java:
If-else can behave differently from sequence of two ifs
If-else can behave differently from sequence of two ifs
I am not sure what's right.
In Java:
If-else is equivalent to sequence of two ifs
If-else is equivalent to sequence of two ifs
In Java:
The constructor allocates the object
The constructor allocates the object
I am not sure what's right.
In Java:
The constructor does not allocate the object, it just initializes it
The constructor does not allocate the object, it just initializes it
In Java:
Formal constructor parameters are completely separate from instance variables
Formal constructor parameters are completely separate from instance variables
I am not sure what's right.
In Java:
Formal constructor parameters are equivalent to instance variables
Formal constructor parameters are equivalent to instance variables
In Java:
Constructors need to return objects
Constructors need to return objects
I am not sure what's right.
In Java:
Constructors cannot return anything
Constructors cannot return anything
In Java:
The constructor name needs to come after the keyword new to instantiate a class
The constructor name needs to come after the keyword new to instantiate a class
I am not sure what's right.
In Java:
One can write the constructor name, without new, to instantiate a class
One can write the constructor name, without new, to instantiate a class
In Java:
One cannot control access to local variables
One cannot control access to local variables
I am not sure what's right.
In Java:
One can control access to local variables using access modifiers
One can control access to local variables using access modifiers
In Java:
A return statement in the middle of a method doesn't return immediately
A return statement in the middle of a method doesn't return immediately
I am not sure what's right.
In Java:
A return statement immediately returns from the method
A return statement immediately returns from the method
In Java:
There is no special keyword for multi-way conditional statements
There is no special keyword for multi-way conditional statements
I am not sure what's right.
In Java:
There is an elsif keyword for multi-way conditional statements
There is an elsif keyword for multi-way conditional statements
In Java:
The else branch of an if-else statement always executes
The else branch of an if-else statement always executes
I am not sure what's right.
In Java:
The else branch of an if-else statement only executes if the condition evaluates to false
The else branch of an if-else statement only executes if the condition evaluates to false
In Java:
o==p compares the references stored in the variables o and p
o==p compares the references stored in the variables o and p
I am not sure what's right.
In Java:
o==p compares the objects referred to by variables o and p
o==p compares the objects referred to by variables o and p
In Java:
o.equals(p) compares the objects referred to by variables o and p
o.equals(p) compares the objects referred to by variables o and p
I am not sure what's right.
In Java:
o.equals(p) compares the references stored in the variables o and p
o.equals(p) compares the references stored in the variables o and p
In Java:
Evaluating an expression means outputting its result
Evaluating an expression means outputting its result
I am not sure what's right.
In Java:
Evaluating an expression produces a value, but does not output it
Evaluating an expression produces a value, but does not output it
In Java:
Exception is the top-most exception class
Exception is the top-most exception class
I am not sure what's right.
In Java:
Throwable is the top-most exception class
Throwable is the top-most exception class
In Java:
An expression that reads a variable also updates its value after the evaluation
An expression that reads a variable also updates its value after the evaluation
I am not sure what's right.
In Java:
A variable is only written using an assignment
A variable is only written using an assignment
In Java:
The type of expressions is determined, without evaluation, at compile time
The type of expressions is determined, without evaluation, at compile time
I am not sure what's right.
In Java:
One has to evaluate an expression to determine its type
One has to evaluate an expression to determine its type
In Java:
An object referred to by a final variable can be a mutable object
An object referred to by a final variable can be a mutable object
I am not sure what's right.
In Java:
An object referred to by a final variable is an immutable object
An object referred to by a final variable is an immutable object
In Java:
An enhanced for loop iterates over the elements of an array or a collection
An enhanced for loop iterates over the elements of an array or a collection
I am not sure what's right.
In Java:
An enhanced for loop iterates over the indices of an array or a collection
An enhanced for loop iterates over the indices of an array or a collection
In Java:
For-each loops know how to traverse any recursive data structure
For-each loops know how to traverse any recursive data structure
I am not sure what's right.
In Java:
For-each loops only know how to traverse arrays and Iterables
For-each loops only know how to traverse arrays and Iterables
In Java:
The variable of an enhanced for statement contains a copy of the value of the corresponding array or collection element
The variable of an enhanced for statement contains a copy of the value of the corresponding array or collection element
I am not sure what's right.
In Java:
One can assign to the variable of an enhanced for statement to store a value in the corresponding array or collection element
One can assign to the variable of an enhanced for statement to store a value in the corresponding array or collection element
In Java:
The body of a for statement executes at most once
The body of a for statement executes at most once
I am not sure what's right.
In Java:
The body of a for statement executes repeatedly, as long as the condition holds
The body of a for statement executes repeatedly, as long as the condition holds
In Java:
The scope of variables declared in a for loop header is limited to the loop
The scope of variables declared in a for loop header is limited to the loop
I am not sure what's right.
In Java:
The scope of variables declared in a for loop header extends beyond the loop
The scope of variables declared in a for loop header extends beyond the loop
In Java:
A stack frame is the same as an instance of a class
A stack frame is the same as an instance of a class
I am not sure what's right.
In Java:
Stack frames and class instances both hold variables, but they are different concepts
Stack frames and class instances both hold variables, but they are different concepts
In Java:
The body of an if statement executes at most once
The body of an if statement executes at most once
I am not sure what's right.
In Java:
The body of an if statement executes repeatedly, as long as the condition holds
The body of an if statement executes repeatedly, as long as the condition holds
In Java:
Every if statement requires an else
Every if statement requires an else
I am not sure what's right.
In Java:
If statements do not necessarily require an else
If statements do not necessarily require an else
In Java:
Immutable classes can have constructor/method parameters that are not final
Immutable classes can have constructor/method parameters that are not final
I am not sure what's right.
In Java:
Immutable classes need final constructor/method parameters
Immutable classes need final constructor/method parameters
In Java:
Java implicitly produces implementations of any methods a class inherits from the interfaces it implements
Java implicitly produces implementations of any methods a class inherits from the interfaces it implements
I am not sure what's right.
In Java:
Java does not implicitly produce implementations of any methods a class inherits from the interfaces it implements
Java does not implicitly produce implementations of any methods a class inherits from the interfaces it implements
In Java:
Dividing two integers always produces an integer
Dividing two integers always produces an integer
I am not sure what's right.
In Java:
Dividing two integers can produce a rational number
Dividing two integers can produce a rational number
In Java:
An interface cannot extend a class
An interface cannot extend a class
I am not sure what's right.
In Java:
An interface can extend a class
An interface can extend a class
In Java:
Integer numbers without L or l suffix that are too large for an int are illegal
Integer numbers without L or l suffix that are too large for an int are illegal
I am not sure what's right.
In Java:
Large integer numbers have type long
Large integer numbers have type long
In Java:
A literal is not an expression
A literal is not an expression
I am not sure what's right.
In Java:
Even an individual literal is an expression
Even an individual literal is an expression
In Java:
String literals always must be surrounded by quotes
String literals always must be surrounded by quotes
I am not sure what's right.
In Java:
When passing a literal string as argument to a method, no quotes are needed
When passing a literal string as argument to a method, no quotes are needed
In Java:
Local variables must be initialized explicitly
Local variables must be initialized explicitly
I am not sure what's right.
In Java:
Local variables are automatically initialized
Local variables are automatically initialized
In Java:
Lifetime of variables declared in a loop body is limited to one loop iteration
Lifetime of variables declared in a loop body is limited to one loop iteration
I am not sure what's right.
In Java:
Lifetime of variables declared in a loop body extends across all loop iterations
Lifetime of variables declared in a loop body extends across all loop iterations
In Java:
For and while loops end when the condition becomes false
For and while loops end when the condition becomes false
I am not sure what's right.
In Java:
For and while loops end when the condition becomes true
For and while loops end when the condition becomes true
In Java:
To map a boolean expression to a boolean, one can just use it
To map a boolean expression to a boolean, one can just use it
I am not sure what's right.
In Java:
To map a boolean expression to a boolean, a conditional operator is necessary
To map a boolean expression to a boolean, a conditional operator is necessary
In Java:
To map a boolean expression to a boolean, one can just use it
To map a boolean expression to a boolean, one can just use it
I am not sure what's right.
In Java:
To map a boolean expression to a boolean, an if statement is necessary
To map a boolean expression to a boolean, an if statement is necessary
In Java:
Each object contains its own special fields for all of its methods
Each object contains its own special fields for all of its methods
I am not sure what's right.
In Java:
Each object contains a special field referring to its class, and the class knows about its methods
Each object contains a special field referring to its class, and the class knows about its methods
In Java:
A method declaration does not need to include a return type
A method declaration does not need to include a return type
I am not sure what's right.
In Java:
A method declaration must include a return type
A method declaration must include a return type
In Java:
Methods can be defined outside a class
Methods can be defined outside a class
I am not sure what's right.
In Java:
Methods must be defined inside a class
Methods must be defined inside a class
In Java:
A reference variable can point to multiple objects
A reference variable can point to multiple objects
I am not sure what's right.
In Java:
A reference variable can point to only one object at a time
A reference variable can point to only one object at a time
In Java:
A variable can contain more than one value
A variable can contain more than one value
I am not sure what's right.
In Java:
A variable can contain only one value at a time
A variable can contain only one value at a time
In Java:
A multi-dimensional array is one single array object
A multi-dimensional array is one single array object
I am not sure what's right.
In Java:
A multi-dimensional is a structure of nested arrays
A multi-dimensional is a structure of nested arrays
In Java:
A class can have multiple superclasses
A class can have multiple superclasses
I am not sure what's right.
In Java:
A class can have only one direct superclass
A class can have only one direct superclass
In Java:
Constructors do not need to assign values to all fields
Constructors do not need to assign values to all fields
I am not sure what's right.
In Java:
Constructors must assign values to all fields
Constructors must assign values to all fields
In Java:
To instantiate a generic type, for each type parameter one only needs to specify the type
To instantiate a generic type, for each type parameter one only needs to specify the type
I am not sure what's right.
In Java:
To instantiate a generic type, for each type parameter one has to specify both the name and the type
To instantiate a generic type, for each type parameter one has to specify both the name and the type
In Java:
Classes are independent of object containment
Classes are independent of object containment
I am not sure what's right.
In Java:
If objects are part of a containment hierarchy, their classes are nested, too
If objects are part of a containment hierarchy, their classes are nested, too
In Java:
Sub-packages are independent of their parent packages and do not have special access rights
Sub-packages are independent of their parent packages and do not have special access rights
I am not sure what's right.
In Java:
Packages can contain other packages which have access to members of the containing package
Packages can contain other packages which have access to members of the containing package
In Java:
Expressions must consist of more than one piece
Expressions must consist of more than one piece
I am not sure what's right.
In Java:
A single piece, like a literal or name, also is an expression
A single piece, like a literal or name, also is an expression
In Java:
One can invoke methods on String literals
One can invoke methods on String literals
I am not sure what's right.
In Java:
One cannot invoke methods on String literals
One cannot invoke methods on String literals
In Java:
A variable being at least as big (bit-width) as a value may not be sufficient to avoid a cast when assigning the value to the variable
A variable being at least as big (bit-width) as a value may not be sufficient to avoid a cast when assigning the value to the variable
I am not sure what's right.
In Java:
If a variable is at least as big (bit-width) as a value, then no cast is needed to a assign the value to the variable
If a variable is at least as big (bit-width) as a value, then no cast is needed to a assign the value to the variable
In Java:
\ is an escape character in char and String literals
\ is an escape character in char and String literals
I am not sure what's right.
In Java:
\ is a normal character in char and String literals
\ is a normal character in char and String literals
In Java:
A constructor's body can be empty
A constructor's body can be empty
I am not sure what's right.
In Java:
A constructor must do something
A constructor must do something
In Java:
An object contains only the fields declared in its class
An object contains only the fields declared in its class
I am not sure what's right.
In Java:
An object contains the fields declared in its class and all its superclasses
An object contains the fields declared in its class and all its superclasses
In Java:
Objects without instance variables can't exist
Objects without instance variables can't exist
I am not sure what's right.
In Java:
Objects can have any number of instance variables, including zero
Objects can have any number of instance variables, including zero
In Java:
There are no float literals
There are no float literals
I am not sure what's right.
In Java:
An F or f suffix can turn a number into a float literal
An F or f suffix can turn a number into a float literal
In Java:
Smaller types can be automatically converted into bigger ones even without an explicit cast
Smaller types can be automatically converted into bigger ones even without an explicit cast
I am not sure what's right.
In Java:
Smaller types are never automatically converted into bigger ones without an explicit cast
Smaller types are never automatically converted into bigger ones without an explicit cast
In Java:
It is allow to call other methods on the same object while inside its constructor
It is allow to call other methods on the same object while inside its constructor
I am not sure what's right.
In Java:
It is foirbidden to call other methods on the same object while inside its constructor
It is foirbidden to call other methods on the same object while inside its constructor
In Java:
Multi-dimensional arrays have a rectangular shape
Multi-dimensional arrays have a rectangular shape
I am not sure what's right.
In Java:
Multi-dimensional arrays can have a jagged shape
Multi-dimensional arrays can have a jagged shape
In Java:
There are no local variables
There are no local variables
I am not sure what's right.
In Java:
Methods can have local variables
Methods can have local variables
In Java:
There are no long literals
There are no long literals
I am not sure what's right.
In Java:
An L or l suffix can turn a number into a long literal
An L or l suffix can turn a number into a long literal
In Java:
Subclasses inherit both fields and methods
Subclasses inherit both fields and methods
I am not sure what's right.
In Java:
Subclasses inherit fields but not methods
Subclasses inherit fields but not methods
In Java:
Every sequence of letters and digits starting with a letter can be used as an identifier
Every sequence of letters and digits starting with a letter can be used as an identifier
I am not sure what's right.
In Java:
Some character sequences are reserved for use as keywords and cannot be used as identifiers
Some character sequences are reserved for use as keywords and cannot be used as identifiers
In Java:
&& and || always evaluate both operands
&& and || always evaluate both operands
I am not sure what's right.
In Java:
&& and || evaluate their right operand only if absolutely necessary
&& and || evaluate their right operand only if absolutely necessary
In Java:
& is only a bitwise AND
& is only a bitwise AND
I am not sure what's right.
In Java:
& for boolean operands is a logical AND
& for boolean operands is a logical AND
In Java:
One can invoke toString() on a String
One can invoke toString() on a String
I am not sure what's right.
In Java:
One cannot invoke toString() on a String
One cannot invoke toString() on a String
In Java:
null is a reference pointing to no object
null is a reference pointing to no object
I am not sure what's right.
In Java:
null is an object
null is an object
In Java:
NullPointerExceptions are detected at compile time
NullPointerExceptions are detected at compile time
I am not sure what's right.
In Java:
NullPointerExceptions are detected at runtime
NullPointerExceptions are detected at runtime
In Java:
Numeric types cannot be coerced to boolean
Numeric types cannot be coerced to boolean
I am not sure what's right.
In Java:
Numeric types can be coerced to boolean
Numeric types can be coerced to boolean
In Java:
A variable is needed to instantiate an object
A variable is needed to instantiate an object
I am not sure what's right.
In Java:
Objects have no name and can exist without a variable referring to them
Objects have no name and can exist without a variable referring to them
In Java:
Only the elements of the innermost array of a multi-dimensional array are accessible
Only the elements of the innermost array of a multi-dimensional array are accessible
I am not sure what's right.
In Java:
Also the elements of outer arrays of a multi-dimensional array are accessible
Also the elements of outer arrays of a multi-dimensional array are accessible
In Java:
Out-of-bounds array elements cannot be accessed
Out-of-bounds array elements cannot be accessed
I am not sure what's right.
In Java:
Out-of-bounds array elements are null
Out-of-bounds array elements are null
In Java:
Nested method calls are invoked inside out
Nested method calls are invoked inside out
I am not sure what's right.
In Java:
Nested method calls are invoked outside in
Nested method calls are invoked outside in
In Java:
() are mandatory even for method calls without arguments
() are mandatory even for method calls without arguments
I am not sure what's right.
In Java:
() are optional for method calls without arguments
() are optional for method calls without arguments
In Java:
Pre-increment in update part of for loop means increment before loop body
Pre-increment in update part of for loop means increment before loop body
I am not sure what's right.
In Java:
Pre-increment in update part of for loop means same as pre-increment anywhere else
Pre-increment in update part of for loop means same as pre-increment anywhere else
In Java:
Primitive values are heap objects
Primitive values are heap objects
I am not sure what's right.
In Java:
Primitive values are not objects
Primitive values are not objects
In Java:
Type parameters of generic types need to be instantiated with reference types
Type parameters of generic types need to be instantiated with reference types
I am not sure what's right.
In Java:
Type parameters of generic types can be instantiated with primitive types
Type parameters of generic types can be instantiated with primitive types
In Java:
The type of a primitive variable depends on its value
The type of a primitive variable depends on its value
I am not sure what's right.
In Java:
The type of a primitive variable is fixed and does not depend on its value
The type of a primitive variable is fixed and does not depend on its value
In Java:
Private members of a superclass are not accessible from a subclass
Private members of a superclass are not accessible from a subclass
I am not sure what's right.
In Java:
Private members of a superclass are accessible from a subclass
Private members of a superclass are accessible from a subclass
In Java:
A class where all fields are private can still be mutable
A class where all fields are private can still be mutable
I am not sure what's right.
In Java:
A class where all fields are private is immutable
A class where all fields are private is immutable
In Java:
An object cannot access private members of other objects of the same class
An object cannot access private members of other objects of the same class
I am not sure what's right.
In Java:
An object can access private members of all other objects of the same class
An object can access private members of all other objects of the same class
In Java:
Static methods cannot access private members of instances of same class
Static methods cannot access private members of instances of same class
I am not sure what's right.
In Java:
Static methods can access private members of instances of same class
Static methods can access private members of instances of same class
In Java:
Even a private field can be mutable
Even a private field can be mutable
I am not sure what's right.
In Java:
A private field cannot be changed
A private field cannot be changed
In Java:
Rational fractions are divisions of two integer literals
Rational fractions are divisions of two integer literals
I am not sure what's right.
In Java:
Rational fractions are literals
Rational fractions are literals
In Java:
Recursive calls of a method share a stack frame
Recursive calls of a method share a stack frame
I am not sure what's right.
In Java:
Each recursive call of a method gets its own stack frame
Each recursive call of a method gets its own stack frame
In Java:
Tail-recursive call sites of non-void methods need no return statement
Tail-recursive call sites of non-void methods need no return statement
I am not sure what's right.
In Java:
In non-void methods, even tail-recursive call sites need a return statement
In non-void methods, even tail-recursive call sites need a return statement
In Java:
A class with a recursive method represents part of a recursive data structure
A class with a recursive method represents part of a recursive data structure
I am not sure what's right.
In Java:
A class having a recursive method does not imply that it is part of a recursive data structure
A class having a recursive method does not imply that it is part of a recursive data structure
In Java:
A recursive method does not necessarily need to contain an if-else statement
A recursive method does not necessarily need to contain an if-else statement
I am not sure what's right.
In Java:
A recursive method needs to contain an if-else statement
A recursive method needs to contain an if-else statement
In Java:
References can only point into the heap
References can only point into the heap
I am not sure what's right.
In Java:
References can point into the stack
References can point into the stack
In Java:
Every reference type can be coerced to boolean
Every reference type can be coerced to boolean
I am not sure what's right.
In Java:
Not every reference type can be coerced to boolean
Not every reference type can be coerced to boolean
In Java:
One can cast between references and ints
One can cast between references and ints
I am not sure what's right.
In Java:
One cannot cast between references and ints
One cannot cast between references and ints
In Java:
References can only point to heap objects
References can only point to heap objects
I am not sure what's right.
In Java:
References can point to variables
References can point to variables
In Java:
If a class refers to a recursive data structure, it is not necessarily part of that recursion
If a class refers to a recursive data structure, it is not necessarily part of that recursion
I am not sure what's right.
In Java:
A class referring to a recursive data structure is (indirectly) part of that recursion as well
A class referring to a recursive data structure is (indirectly) part of that recursion as well
In Java:
Return statements need () around the return value
Return statements need () around the return value
I am not sure what's right.
In Java:
Return statements do not need () around the return value
Return statements do not need () around the return value
In Java:
A return statement pops exactly one call stack frame
A return statement pops exactly one call stack frame
I am not sure what's right.
In Java:
A return statement can unwind multiple call stack frames
A return statement can unwind multiple call stack frames
In Java:
Chained accesses are invoked from left to right
Chained accesses are invoked from left to right
I am not sure what's right.
In Java:
Chained accesses are invoked from right to left
Chained accesses are invoked from right to left
In Java:
RuntimeExceptions are checked exceptions
RuntimeExceptions are checked exceptions
I am not sure what's right.
In Java:
RuntimeExceptions are unchecked exceptions
RuntimeExceptions are unchecked exceptions
In Java:
String literals can be in single quotes
String literals can be in single quotes
I am not sure what's right.
In Java:
String literals must be in double quotes
String literals must be in double quotes
In Java:
A stack trace is the sequence of previously called methods
A stack trace is the sequence of previously called methods
I am not sure what's right.
In Java:
A stack trace only includes the currently active methods
A stack trace only includes the currently active methods
In Java:
A static method call is dispatched based on the declared types of the arguments
A static method call is dispatched based on the declared types of the arguments
I am not sure what's right.
In Java:
A static method call is dispatched polymorphically at runtime based on the argument types
A static method call is dispatched polymorphically at runtime based on the argument types
In Java:
The method to be called is determined by the static type
The method to be called is determined by the static type
I am not sure what's right.
In Java:
The method to be called is determined by the dynamic type
The method to be called is determined by the dynamic type
In Java:
One can know the length of a String object by calling its length method
One can know the length of a String object by calling its length method
I am not sure what's right.
In Java:
One can know the length of a String object by accessing its length field
One can know the length of a String object by accessing its length field
In Java:
A String literal represents a String object and can be treated as such
A String literal represents a String object and can be treated as such
I am not sure what's right.
In Java:
One needs to call the String constructor to get a String object from a literal
One needs to call the String constructor to get a String object from a literal
In Java:
String concatenation evaluates non-String operand expressions and casts value to String
String concatenation evaluates non-String operand expressions and casts value to String
I am not sure what's right.
In Java:
String concatenation stringifies non-String operand expressions
String concatenation stringifies non-String operand expressions
In Java:
The multiplication operator can repeat a String a number of times
The multiplication operator can repeat a String a number of times
I am not sure what's right.
In Java:
The multiplication operator does not accept a String and a number
The multiplication operator does not accept a String and a number
In Java:
A variable of a subtype can reference an object of a supertype
A variable of a subtype can reference an object of a supertype
I am not sure what's right.
In Java:
A variable of a subtype cannot reference an object of a supertype
A variable of a subtype cannot reference an object of a supertype
In Java:
To call a method on a superclass, it is wrong to write parentheses after the keyword super
To call a method on a superclass, it is wrong to write parentheses after the keyword super
I am not sure what's right.
In Java:
To call a method on a superclass, parentheses are needed after the keyword super
To call a method on a superclass, parentheses are needed after the keyword super
In Java:
super() can be called anywhere in the constructor of a subclass
super() can be called anywhere in the constructor of a subclass
I am not sure what's right.
In Java:
super() must be called in the first statement in the constructor of a subclass
super() must be called in the first statement in the constructor of a subclass
In Java:
When instantiating an object of a subclass, just that object is allocated
When instantiating an object of a subclass, just that object is allocated
I am not sure what's right.
In Java:
When instantiating an object of a subclass, an object of a superclass is also allocated
When instantiating an object of a subclass, an object of a superclass is also allocated
In Java:
A variable of a supertype can reference an object of a subtype
A variable of a supertype can reference an object of a subtype
I am not sure what's right.
In Java:
A variable of a supertype cannot reference an object of a subtype
A variable of a supertype cannot reference an object of a subtype
In Java:
The type of a numerical expression is determined by the expression
The type of a numerical expression is determined by the expression
I am not sure what's right.
In Java:
The type of a numerical expression depends on the type expected by the surrounding context
The type of a numerical expression depends on the type expected by the surrounding context
In Java:
this is a special local variable in the stack frame
this is a special local variable in the stack frame
I am not sure what's right.
In Java:
this is a special field in the object
this is a special field in the object
In Java:
One can assign to this
One can assign to this
I am not sure what's right.
In Java:
One cannot assign to this
One cannot assign to this
In Java:
this can be null
this can be null
I am not sure what's right.
In Java:
this is never null
this is never null
In Java:
this is a local variable, also in static methods
this is a local variable, also in static methods
I am not sure what's right.
In Java:
this does not exist in static methods
this does not exist in static methods
In Java:
In a constructor, this is never null
In a constructor, this is never null
I am not sure what's right.
In Java:
In a constructor, this is null
In a constructor, this is null
In Java:
The name this is not an expression
The name this is not an expression
I am not sure what's right.
In Java:
Even the name this on its own is an expression
Even the name this on its own is an expression
In Java:
Invoking toString() does not produce any output
Invoking toString() does not produce any output
I am not sure what's right.
In Java:
Invoking toString() prints something
Invoking toString() prints something
In Java:
When a piece of code can throw an exception, it is optional to surround it with a try/catch block
When a piece of code can throw an exception, it is optional to surround it with a try/catch block
I am not sure what's right.
In Java:
When a piece of code can throw an exception, it must be surrounded with a try/catch block
When a piece of code can throw an exception, it must be surrounded with a try/catch block
In Java:
Exceptions get thrown at the end of the try block
Exceptions get thrown at the end of the try block
I am not sure what's right.
In Java:
Exceptions get thrown immediately when they occur
Exceptions get thrown immediately when they occur
In Java:
Variables must be declared before they are used
Variables must be declared before they are used
I am not sure what's right.
In Java:
Variables can be used even without being declared beforehand
Variables can be used even without being declared beforehand
In Java:
Classes in different packages can have the same unqualified name
Classes in different packages can have the same unqualified name
I am not sure what's right.
In Java:
The unqualified names of different classes must be different
The unqualified names of different classes must be different
In Java:
Variable declarations need a type
Variable declarations need a type
I am not sure what's right.
In Java:
Variable declarations don't need a type
Variable declarations don't need a type
In Java:
A class can have methods with a local variable, parameter, or return value with the class as its type without being a recursive type
A class can have methods with a local variable, parameter, or return value with the class as its type without being a recursive type
I am not sure what's right.
In Java:
If a class has a method that has a local variable, parameter, or return value with the class as its type, the class is a recursive type
If a class has a method that has a local variable, parameter, or return value with the class as its type, the class is a recursive type
In Java:
= stores an expression in a variable
= stores an expression in a variable
I am not sure what's right.
In Java:
= evaluates an expression and stores its value in a variable
= evaluates an expression and stores its value in a variable
In Java:
A variable of a reference type contains a reference to an object
A variable of a reference type contains a reference to an object
I am not sure what's right.
In Java:
A variable of a reference type contains a whole object
A variable of a reference type contains a whole object
In Java:
A method with void return type can't be recursive
A method with void return type can't be recursive
I am not sure what's right.
In Java:
A method with void return type can be recursive
A method with void return type can be recursive
In Java:
A method with void return type cannot return a value
A method with void return type cannot return a value
I am not sure what's right.
In Java:
A method with void return type can return a value
A method with void return type can return a value
In Java:
In integer numbers, decimal digits with value `0` take less storage than decimal digits with other values
In integer numbers, decimal digits with value `0` take less storage than decimal digits with other values
I am not sure what's right.
In Java:
In integer numbers, all decimal digits take the same amount of storage
In integer numbers, all decimal digits take the same amount of storage
In JavaScript:
Accessing a non existent property on an object produces an error
Accessing a non existent property on an object produces an error
I am not sure what's right.
In JavaScript:
Accessing a non existent property on an object evaluates to undefined
Accessing a non existent property on an object evaluates to undefined
In JavaScript:
When an arrow function consists just of an expression, the return keyword is implied
When an arrow function consists just of an expression, the return keyword is implied
I am not sure what's right.
In JavaScript:
Even when an arrow function consists just of an expression, the return keyword must be explicitly written
Even when an arrow function consists just of an expression, the return keyword must be explicitly written
In JavaScript:
Arrow functions do not require the keyword 'function'
Arrow functions do not require the keyword 'function'
I am not sure what's right.
In JavaScript:
Arrow functions also require the keyword 'function'
Arrow functions also require the keyword 'function'
In JavaScript:
Assignment copies the reference pointing to the object
Assignment copies the reference pointing to the object
I am not sure what's right.
In JavaScript:
Assignment copies the object
Assignment copies the object
In JavaScript:
Parameters of a callback function may be written as parameters of the caller function
Parameters of a callback function may be written as parameters of the caller function
I am not sure what's right.
In JavaScript:
A function that expects a callback has that callback function as a parameter
A function that expects a callback has that callback function as a parameter
In JavaScript:
A single character is of type string
A single character is of type string
I am not sure what's right.
In JavaScript:
A single character is of type char
A single character is of type char
In JavaScript:
A class definition does not define a type; all objects have type object
A class definition does not define a type; all objects have type object
I am not sure what's right.
In JavaScript:
The type of an object is equivalent to the type defined by its class definition
The type of an object is equivalent to the type defined by its class definition
In JavaScript:
The conditional operator is not an expression
The conditional operator is not an expression
I am not sure what's right.
In JavaScript:
The conditional operator is not an expression
The conditional operator is not an expression
In JavaScript:
Declarations of constants do not need to be immediately initialized
Declarations of constants do not need to be immediately initialized
I am not sure what's right.
In JavaScript:
Declarations of constants need to be immediately initialized
Declarations of constants need to be immediately initialized
In JavaScript:
An object referred to by a const variable can be a mutable object
An object referred to by a const variable can be a mutable object
I am not sure what's right.
In JavaScript:
An object referred to by a const variable is an immutable object
An object referred to by a const variable is an immutable object
In JavaScript:
The equality operator compares two objects' references
The equality operator compares two objects' references
I am not sure what's right.
In JavaScript:
The equality operator compares two objects' values
The equality operator compares two objects' values
In JavaScript:
The equality operator '==' compares only the types of the operands
The equality operator '==' compares only the types of the operands
I am not sure what's right.
In JavaScript:
The equality operator '==' compares only the values of the operands
The equality operator '==' compares only the values of the operands
In JavaScript:
To use a function as a value, one just needs to write its name
To use a function as a value, one just needs to write its name
I am not sure what's right.
In JavaScript:
To use a function as a value, one needs to have parentheses after its name
To use a function as a value, one needs to have parentheses after its name
In JavaScript:
It not is possible to create multiple functions with the same name but with different signatures
It not is possible to create multiple functions with the same name but with different signatures
I am not sure what's right.
In JavaScript:
It is possible to create multiple functions with the same name but with different signatures
It is possible to create multiple functions with the same name but with different signatures
In JavaScript:
Functions can be immediately called in the expression in which they are defined
Functions can be immediately called in the expression in which they are defined
I am not sure what's right.
In JavaScript:
Functions cannot be called in the expression in which they are defined
Functions cannot be called in the expression in which they are defined
In JavaScript:
Every function definition requires an associated name
Every function definition requires an associated name
I am not sure what's right.
In JavaScript:
One can define a function without associating a name to it
One can define a function without associating a name to it
In JavaScript:
An identifier used to access a property with the bracket notation is firstly evaluated
An identifier used to access a property with the bracket notation is firstly evaluated
I am not sure what's right.
In JavaScript:
An identifier used to access a property with the bracket notation is treated as a string
An identifier used to access a property with the bracket notation is treated as a string
In JavaScript:
An expression must be assigned to have a valid statement
An expression must be assigned to have a valid statement
I am not sure what's right.
In JavaScript:
An expression alone, without an assignment, is already a valid statement
An expression alone, without an assignment, is already a valid statement
In JavaScript:
Map returns a new array populated with the results of the callback function
Map returns a new array populated with the results of the callback function
I am not sure what's right.
In JavaScript:
Map modifies the elements of the array on which it operates in place
Map modifies the elements of the array on which it operates in place
In JavaScript:
Expressions must consist of more than one piece
Expressions must consist of more than one piece
I am not sure what's right.
In JavaScript:
A single piece, like a literal or name, also is an expression
A single piece, like a literal or name, also is an expression
In JavaScript:
Square brackets can be used to access properties of an object
Square brackets can be used to access properties of an object
I am not sure what's right.
In JavaScript:
Square brackets cannot be used to access properties of an object
Square brackets cannot be used to access properties of an object
In JavaScript:
Multiple function calls can be chained together
Multiple function calls can be chained together
I am not sure what's right.
In JavaScript:
It is not allowed to chain function calls
It is not allowed to chain function calls
In JavaScript:
There is always a global object
There is always a global object
I am not sure what's right.
In JavaScript:
There isn't a global object
There isn't a global object
In JavaScript:
Functions without return statements return undefined
Functions without return statements return undefined
I am not sure what's right.
In JavaScript:
Functions without return statements return no value at all
Functions without return statements return no value at all
In JavaScript:
null and undefined are two distinct values
null and undefined are two distinct values
I am not sure what's right.
In JavaScript:
The values null and undefined are the same
The values null and undefined are the same
In JavaScript:
null is a reference pointing to no object
null is a reference pointing to no object
I am not sure what's right.
In JavaScript:
null is an object
null is an object
In JavaScript:
Functions must be called with the same number of arguments as defined in their signature
Functions must be called with the same number of arguments as defined in their signature
I am not sure what's right.
In JavaScript:
Functions can be called with a different number of arguments as defined in their signature
Functions can be called with a different number of arguments as defined in their signature
In JavaScript:
Objects are passed by value
Objects are passed by value
I am not sure what's right.
In JavaScript:
Objects are passed by reference
Objects are passed by reference
In JavaScript:
JavaScript is based on a class-based object model
JavaScript is based on a class-based object model
I am not sure what's right.
In JavaScript:
JavaScript is based on a prototype-based object model
JavaScript is based on a prototype-based object model
In JavaScript:
One can repeat a String by multiplying it with a number
One can repeat a String by multiplying it with a number
I am not sure what's right.
In JavaScript:
One cannot repeat a String by multiplying it with a number
One cannot repeat a String by multiplying it with a number
In JavaScript:
One can assign to this
One can assign to this
I am not sure what's right.
In JavaScript:
One cannot assign to this
One cannot assign to this
In JavaScript:
The typeof operator applied on an array returns 'array'
The typeof operator applied on an array returns 'array'
I am not sure what's right.
In JavaScript:
The typeof operator applied on an array returns 'object'
The typeof operator applied on an array returns 'object'
In JavaScript:
The value null is of type 'object'
The value null is of type 'object'
I am not sure what's right.
In JavaScript:
The value null is of type 'null'
The value null is of type 'null'
In Python:
= compares two values
= compares two values
I am not sure what's right.
In Python:
= assigns a value to a variable
= assigns a value to a variable
In Python:
Assignment copies the object
Assignment copies the object
I am not sure what's right.
In Python:
Assignment copies the reference to the object
Assignment copies the reference to the object
In Python:
Attribute accesses cannot be chained together
Attribute accesses cannot be chained together
I am not sure what's right.
In Python:
Attribute accesses can be chained together
Attribute accesses can be chained together
In Python:
Method calls, and attribute accesses in general, cannot be chained to a constructor invocation.
Method calls, and attribute accesses in general, cannot be chained to a constructor invocation.
I am not sure what's right.
In Python:
Method calls, and attribute accesses in general, can be chained to a constructor invocation.
Method calls, and attribute accesses in general, can be chained to a constructor invocation.
In Python:
To test whether an expression is True or False, one can just use it
To test whether an expression is True or False, one can just use it
I am not sure what's right.
In Python:
To test whether an expression is True or False, one must compare it to True or to False
To test whether an expression is True or False, one must compare it to True or to False
In Python:
If-else is equivalent to sequence of two ifs
If-else is equivalent to sequence of two ifs
I am not sure what's right.
In Python:
If-else can behave differently from sequence of two ifs
If-else can behave differently from sequence of two ifs
In Python:
A return statement immediately returns from the function
A return statement immediately returns from the function
I am not sure what's right.
In Python:
A return statement in the middle of a function doesn't return immediately
A return statement in the middle of a function doesn't return immediately
In Python:
The body of an if-statement executes at most once
The body of an if-statement executes at most once
I am not sure what's right.
In Python:
The body of an if-statement executes repeatedly, as long as the condition holds
The body of an if-statement executes repeatedly, as long as the condition holds
In Python:
__init__ must create a new object
__init__ must create a new object
I am not sure what's right.
In Python:
__init__ does not create the object, it just initializes it
__init__ does not create the object, it just initializes it
In Python:
__init__ cannot return values other than None
__init__ cannot return values other than None
I am not sure what's right.
In Python:
__init__ needs to return an object
__init__ needs to return an object
In Python:
To map a boolean expression to a bool, an if statement is necessary
To map a boolean expression to a bool, an if statement is necessary
I am not sure what's right.
In Python:
To map a boolean expression to a bool, one can just use it
To map a boolean expression to a bool, one can just use it
In Python:
To map a boolean expression to a bool, a ternary conditional operator is necessary
To map a boolean expression to a bool, a ternary conditional operator is necessary
I am not sure what's right.
In Python:
To map a boolean expression to a bool, one can just use it
To map a boolean expression to a bool, one can just use it
In Python:
Functions can only return one value
Functions can only return one value
I am not sure what's right.
In Python:
Functions can return multiple values
Functions can return multiple values
In Python:
Expressions must consist of more than one piece
Expressions must consist of more than one piece
I am not sure what's right.
In Python:
A single piece, like a literal or name, also is an expression
A single piece, like a literal or name, also is an expression
In Python:
The body of __init__ can be empty
The body of __init__ can be empty
I am not sure what's right.
In Python:
__init__ must do something
__init__ must do something
In Python:
Every sequence of letters and digits starting with a letter or an underscore can be used as an identifier
Every sequence of letters and digits starting with a letter or an underscore can be used as an identifier
I am not sure what's right.
In Python:
Some character sequences are reserved for use as keywords and cannot be used as identifiers
Some character sequences are reserved for use as keywords and cannot be used as identifiers
In Python:
The * operator can be used to repeat sequences
The * operator can be used to repeat sequences
I am not sure what's right.
In Python:
There is no operator that repeats sequences
There is no operator that repeats sequences
In Python:
and/or evaluate their right operand only if absolutely necessary
and/or evaluate their right operand only if absolutely necessary
I am not sure what's right.
In Python:
and/or always evaluate both operands
and/or always evaluate both operands
In Python:
& is only a bitwise AND
& is only a bitwise AND
I am not sure what's right.
In Python:
& for boolean operands is a logical AND
& for boolean operands is a logical AND
In Python:
Objects have no name and can exist without a variable referring to them
Objects have no name and can exist without a variable referring to them
I am not sure what's right.
In Python:
A variable is needed to instantiate an object
A variable is needed to instantiate an object
In Python:
Nested function calls are invoked outside in
Nested function calls are invoked outside in
I am not sure what's right.
In Python:
Nested function calls are invoked inside out
Nested function calls are invoked inside out
In Python:
() are mandatory even for function calls without arguments
() are mandatory even for function calls without arguments
I am not sure what's right.
In Python:
() are optional for function calls without arguments
() are optional for function calls without arguments
In Python:
The plus operator can concatenate strings and numbers
The plus operator can concatenate strings and numbers
I am not sure what's right.
In Python:
The plus operator cannot concatenate strings and numbers
The plus operator cannot concatenate strings and numbers
In Python:
A recursive function does not necessarily need to contain an if-else statement
A recursive function does not necessarily need to contain an if-else statement
I am not sure what's right.
In Python:
A recursive function needs to contain an if-else statement
A recursive function needs to contain an if-else statement
In Python:
Return statements need () around the return value
Return statements need () around the return value
I am not sure what's right.
In Python:
Return statements do not need () around the return value
Return statements do not need () around the return value
In Python:
A return statement pops exactly one call stack frame
A return statement pops exactly one call stack frame
I am not sure what's right.
In Python:
A return statement can unwind multiple call stack frames
A return statement can unwind multiple call stack frames
In Python:
Chained accesses are invoked from right to left
Chained accesses are invoked from right to left
I am not sure what's right.
In Python:
Chained accesses are invoked from left to right
Chained accesses are invoked from left to right
In Python:
Reassigning self does not change the object on which a method is called
Reassigning self does not change the object on which a method is called
I am not sure what's right.
In Python:
Reassigning self changes the object on which a method is called
Reassigning self changes the object on which a method is called
In Python:
Even the name self on its own is an expression
Even the name self on its own is an expression
I am not sure what's right.
In Python:
The name self is not an expression
The name self is not an expression
In Python:
One needs to call str to instantiate a str object from a string literal
One needs to call str to instantiate a str object from a string literal
I am not sure what's right.
In Python:
A string literal represents a str object and can be treated as such
A string literal represents a str object and can be treated as such
In Python:
= evaluates an expression and stores a reference to its value in a variable
= evaluates an expression and stores a reference to its value in a variable
I am not sure what's right.
In Python:
= stores an expression: it stores a reference to the expression in a variable
= stores an expression: it stores a reference to the expression in a variable
In Python:
A variable contains a whole object
A variable contains a whole object
I am not sure what's right.
In Python:
A variable contains a reference to an object
A variable contains a reference to an object
In Scratch:
Recursive computations need a base case to terminate
Recursive computations need a base case to terminate
I am not sure what's right.
In Scratch:
Recursive computations do not necessarily need a base case
Recursive computations do not necessarily need a base case
In Scratch:
To test whether an expression evaluates to true or false, one can just use it
To test whether an expression evaluates to true or false, one can just use it
I am not sure what's right.
In Scratch:
To test whether an expression evaluates to true or false, one must compare it to a constant
To test whether an expression evaluates to true or false, one must compare it to a constant
In Scratch:
If-then-else block is equivalent to sequence of two if-then blocks
If-then-else block is equivalent to sequence of two if-then blocks
I am not sure what's right.
In Scratch:
If-then-else block can behave differently from sequence of two if-then blocks
If-then-else block can behave differently from sequence of two if-then blocks
In Scratch:
The else branch of an if-then-else block always executes
The else branch of an if-then-else block always executes
I am not sure what's right.
In Scratch:
The else branch of an if-then-else block only executes if the condition evaluates to false
The else branch of an if-then-else block only executes if the condition evaluates to false
In Scratch:
(list a) = (list b) compares the contents of list a and list b
(list a) = (list b) compares the contents of list a and list b
I am not sure what's right.
In Scratch:
(list a) = (list b) compares the identities of list a and list b
(list a) = (list b) compares the identities of list a and list b
In Scratch:
() = () compares only the types of its operands
() = () compares only the types of its operands
I am not sure what's right.
In Scratch:
() = () compares the values of its operands
() = () compares the values of its operands
In Scratch:
A variable is only written using an assignment
A variable is only written using an assignment
I am not sure what's right.
In Scratch:
An expression that reads a variable also updates its value after the evaluation
An expression that reads a variable also updates its value after the evaluation
In Scratch:
A list can have a length of 0 items
A list can have a length of 0 items
I am not sure what's right.
In Scratch:
A list cannot have a length of 0 items
A list cannot have a length of 0 items
In Scratch:
A list can contain items of different types
A list can contain items of different types
I am not sure what's right.
In Scratch:
All items in a list must have the same type
All items in a list must have the same type
In Scratch:
Blocks following an if without else will not execute if the condition is false
Blocks following an if without else will not execute if the condition is false
I am not sure what's right.
In Scratch:
Blocks following an if without else will execute even if the condition is false
Blocks following an if without else will execute even if the condition is false
In Scratch:
Each block in a loop is repeated individually
Each block in a loop is repeated individually
I am not sure what's right.
In Scratch:
The whole sequence of blocks in a loop is repeated
The whole sequence of blocks in a loop is repeated
In Scratch:
The computation of a loop iteration starts from the state that is based on everything that happened before, including prior iterations of the loop
The computation of a loop iteration starts from the state that is based on everything that happened before, including prior iterations of the loop
I am not sure what's right.
In Scratch:
The computation of all loop iterations starts from the state before the loop
The computation of all loop iterations starts from the state before the loop
In Scratch:
Running a Scratch program first resets the state of the world and then executes the program
Running a Scratch program first resets the state of the world and then executes the program
I am not sure what's right.
In Scratch:
Running a Scratch program executes the program starting with the world in its current state
Running a Scratch program executes the program starting with the world in its current state