Intro to C sharp Chapter 7-9 true or false

Intro to C sharp Chapter 7-9 true or false

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

The objects of a class can be stored in an array, but not in a List.

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (36)

Section 1

(36 cards)

The objects of a class can be stored in an array, but not in a List.

Front

False; can store in both

Back

Objects that are instances of a class are always passed by value.

Front

False; passed by reference

Back

The get accessor can be thought of as a method that returns the class property's value.

Front

True

Back

A jagged array is similar to a two-dimensional array, but the rows in a jagged array can have different numbers of columns.

Front

TRUE

Back

You can compare enumerators and enum variables with relational operators.

Front

TRUE

Back

An enum declaration can only appear inside the application's namespace.

Front

FALSE; Outside the application's namespace, Inside the application's namespace, and Inside a class

Back

The same rules for naming variables apply to naming classes.

Front

True

Back

Reference variables can be used only to reference objects.

Front

TRUE

Back

Structure objects can be passed into a method only by reference.

Front

FALSE; can be passed by value or by reference

Back

It is a common practice to make all a class's fields private and to provide access to those fields through methods.

Front

TRUE

Back

You cannot perform comparison operations directly on structure objects.

Front

TRUE

Back

You use the == operator to compare two array reference variables and determine whether the arrays are equal.

Front

FALSE; cannot use the == operator

Back

Enumerators must be enclosed in quotation marks.

Front

FALSE; Enumerators must be legal C# identifiers

Back

When you call a string object's Split method, the method divides the string into two substrings and returns them as an array of strings.

Front

FALSE; he method extracts tokens from the string and returns them as an array of strings

Back

It is legal to write a class without any constructors.

Front

True

Back

Arrays are reference type objects.

Front

True

Back

Before you can use the structure to store data, you must create an instance of the structure in memory.

Front

TRUE

Back

If you try to pass a property to a ref or an out parameter, an error will occur.

Front

True

Back

One way to find the classes needed for an object-oriented program is to identify all the verbs in a description of the problem domain.

Front

False; nouns

Back

Class declarations must be written inside the project namespace.

Front

False; not required

Back

When you create a List object, you do not have to know the number of items that you intend to store in it.

Front

TRUE

Back

The fields contained in a structure must be of the same data type.

Front

FALSE; The fields can be of different data types

Back

The subscript of the last element will always be one less than the array's Length property.

Front

TRUE

Back

Every form in a Visual C# project has a class.

Front

True

Back

When you create a numeric array in C#, its elements are set to the value 0 by default.

Front

TRUE

Back

Class fields are almost always declared public in order to make their values easily accessible to code outside of the class.

Front

False; private in order to protect them from accidental corruption

Back

If you need to make a property read only, you simply do not write a set accessor for the property.

Front

True

Back

You cannot store a string in a variable of the char data type.

Front

FALSE; Because char variables can hold only one character

Back

When you are working with a value type, you are using a variable that holds a piece of data.

Front

TRUE

Back

C# allows you to access the individual characters in a string using subscript notation.

Front

TRUE

Back

Individual variables are well suited for storing and processing lists of data.

Front

FALSE; not well suited

Back

ImageList controls are designed to store small images such as icons or thumbnails.

Front

TRUE

Back

The integer values that you assign to enumerators do not have to be unique.

Front

TRUE

Back

Constructors can accept arguments in the same way as other methods.

Front

True

Back

You can store a mixture of data types in an array.

Front

FALSE; cannot

Back

A class is an object.

Front

False; describes the object

Back