Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. The ToString( ) method of the Console class should be overwritten. True False 2. Accessors are special types of methods in C# used to

1.

The ToString( ) method of the Console class should be overwritten.

True

False

2.

Accessors are special types of methods in C# used to instantiate an object of the class.

True

False

3 C# is an object-oriented language as such all the code that you write has to be placed in a(n) ____________. (Hint: class)

4

Three of the contextual keywords associated with properties are get, set, and value.

True

False

5

ToString( ), Equals( ), GetType( ), and GetHashCode( ) are all methods of the object class.

True

False

6

A class named River will have a constructor named River.

True

False

7

Which of the following is NOT a true statement relating to constructors?

A. To add full functionality to your classes, write multiple constructors

B. If you write one constructor, you lose the default one that is created automatically.
C. The default constructor must be the first one written for the class.

D. Constructors are used to provide values to the objects data members.

8

Use a type prefix, such as C for class name. For example, a student class should be named CStudent.

True

False

9.

Which of the following is true regarding methods of a class?

You must use the keyword static.
They are called instance methods.
To call methods of the class in the class, you must prefix the method name with the class name.

No return type is used when you define a class method.

10.

WriteLine(Value = {0:N0}, 12345.9032);

What will be displayed from the above line?

Value = 12,346
Value = 12346
Value = 12,345

Value = 12,346.0

11

Which of the following is NOT one of the inherited member methods of the object class?

ToString( )
Equals( )
GetType( )

Main( )

12

A class is an instance of an object.

True

False

13

___ are special methods used to read the current state or value of an object members data.

Accessors
Mutators
Constructors

Setters

14

C# is an object-oriented language. All the code for an application must be placed in a(n) ____.

file
object
class

method

15

To design a class that is flexible and full-featured, ____.

define a constructor for every possible combination of data members.
define a default constructor.
define at least three constructors.

include multiple constructors.

16

When you define a class method, you define its characteristics or fields in terms of the data.

True

False

17

Since the data members of the class are defined as private, their public property counterpart must be used to assign new values to the data members.

True
False

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 19th International Conference Dexa 2008 Turin Italy September 2008 Proceedings Lncs 5181

Authors: Sourav S. Bhowmick ,Josef Kung ,Roland Wagner

2008th Edition

3540856536, 978-3540856535

More Books

Students also viewed these Databases questions