Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C# 1 .Who can access the protected section of a class? static methods Main child classes that class -and- child classes 2. In .NET, _________

C#

1 .Who can access the protected section of a class?

static methods

Main

child classes

that class -and- child classes

2. In .NET, _________ types are stored on the heap.

Integers

Reference

Structs

Value

3. How can you enable polymorphic behavior between related classes?

it has at least one property

it has at least one static function

it has at least one virtual function

it has at least one constructor

4. What is the value of result?

string name = "Steve";
int result = name.CompareTo("Steve");

5. What is the correct way to call the CreateCar method in other classes?

public static class CarFactory
{
 public static ICar CreateCar(string make, string model)
 {
 return new Car(make, model);
 }
}

ICar yugo = CarFactory.CreateCar("Zastava Automobiles", "Yugo");

CarFactory factory = new CarFactory();

ICar yugo = factory.CreateCar("Zastava Automobiles", "Yugo");

CarFactory factory = new CarFactory();

ICar yugo = factory.CreateCar("Zastava Automobiles", "Yugo", 1980, ConsoleColor.Tan);

ICar yugo = CarFactory.CreateCar("Zastava Automobiles", "Yugo", 1980, ConsoleColor.Tan);

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_2

Step: 3

blur-text-image_3

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 Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions

Question

Describe six biases affecting perception.

Answered: 1 week ago

Question

=+5 Does this case provide an example of the future for IHRM?

Answered: 1 week ago

Question

=+4 How did it affect HR?

Answered: 1 week ago