Ensurepass


QUESTION 31

You are developing an application that includes a class named BookTracker for tracking library books.

The application includes the following code segment. (Line numbers are included for reference only.)

clip_image002

You need to add a user to the BookTracker instance. What should you do?

clip_image004

A. Option A

B. Option B

C. Option C

D. Option D

Correct Answer: B


QUESTION 32

You are creating a console application by using C#.

You need to access the assembly found in the file named car.dll. Which code segment should you use?

A. Assembly.Load ();

B. Assembly.GetExecutingAssembly() ;

C. this.GetType ();

D. Assembly.LoadFile("car.dll");

Correct Answer: D


QUESTION 33

You are developing an application by using C#.

The application includes an object that performs a long running process.

You need to ensure that the garbage collector does not release the object’s resources until the process completes.

Which garbage collector method should you use?

A. WaitForFullGCComplete()

B. WaitForFullGCApproach()

C. KeepAlive()

D. WaitForPendingFinalizers()

Correct Answer: C


QUESTION 34

An application includes a class named Person. The Person class includes a method named GetData.

You need to ensure that the GetData() method can be used only by the Person class and not by any class derived from the Person class.

Which access modifier should you use for the GetData() method?

A. Public

B. Protected Internal

C. Internal

D. Private

E. Protected

Correct Answer: D


QUESTION 35

You are creating an application that manages information about your company’s products. The

application includes a class named Product and a method named Save.

The Save() method must be strongly typed. It must allow only types inherited from the Product class that use a constructor that accepts no parameters.

You need to implement the Save() method. Which code segment should you use?

clip_image006

A. Option A

B. Option B

C. Option C

D. Option D

Correct Answer: D


QUESTION 36

You are developing an application. The application includes classes named Mammal and Animal and an

interface named IAnimal.

The Mammal class must meet the following requirements:

-It must either inherit from the Animal class or implement the IAnimal interface.

-It must be inheritable by other classes in the application.

You need to ensure that the Mammal class meets the requirements.

Which two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

clip_image008

A. Option A

B. Option B

C. Option C

D. Option D

Correct Answer: AC


QUESTION 37

You are developing an application by using C#. The application includes the following code segment.

(Line numbers are included for reference only.)

clip_image010

The DoWork() method must throw an InvalidCastException exception if the obj object is not of type IDataContainer when accessing the Data property.

You need to meet the requirements.

Which code segment should you insert at line 07?

A. var dataContainer = (IDataContainer) obj;

B. dataContainer = obj as IDataContamer;

C. var dataContainer = obj is IDataContainer;

D. dynamic dataContainer = obj;

Correct Answer: A


QUESTION 38

An application receives JSON data in the following format:

clip_image012

The application includes the following code segment. (Line numbers are included for reference only.)

clip_image014

You need to ensure that the ConvertToName() method returns the JSON input string as a Name object. Which code segment should you insert at line 10?

A. Return ser.Desenalize (json, typeof(Name));

B. Return ser.ConvertToType<Name>(json);

C. Return ser.Deserialize<Name>(json);

D. Return ser .ConvertToType (json, typeof (Name) >

Correct Answer: C


QUESTION 39

You are developing an application that includes the following code segment. (Line numbers are

included for reference only.)

clip_image016

The GetCustomers() method must meet the following requirements:

-Connect to a Microsoft SQL Server database.

-Populate Customer objects with data from the database.

-Return an IEnumerable<Customer> collection that contains the populated Customer objects. You need to meet the requirements.

Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A. Insert the following code segment at line 17: while (sqlDataReader.GetValues())

B. Insert the following code segment at line 14: sqlConnection.Open();

C. Insert the following code segment at line 14: sqlConnection.BeginTransaction();

D. Insert the following code segment at line 17: while (sqlDataReader.Read())

E. Insert the following code segment at line 17: while (sqlDataReader.NextResult())

Correct Answer: BD


QUESTION 40

An application will upload data by using HTML form-based encoding. The application uses a method

named SendMessage.

The SendMessage() method includes the following code. (Line numbers are included for reference only.)

clip_image017

The receiving URL accepts parameters as form-encoded values.

You need to send the values intA and intB as form-encoded values named a and b, respectively. Which code segment should you insert at line 04?

clip_image019

A. Option A

B. Option B

C. Option C

D. Option D

Correct Answer: D

Download Latest 70-483 Real Free Tests , help you to pass exam 100%.

Comments are closed.