GSSP-NET · Question #442
You work as a Software Developer for ABC Inc. The company uses Visual Studio.NET 2005 as its application development platform. You are developing an application that will manage rental properties…
The correct answer is A. DateTime? leaseStartDate = null. See the full explanation below for the reasoning.
Question
You work as a Software Developer for ABC Inc. The company uses Visual Studio.NET 2005 as its application development platform. You are developing an application that will manage rental properties for a property management agency. When a property is rented, a lease agreement is created. At that time a new lease is entered into the application, the starting date of the lease may not yet be known. You need to write code that stores the lease start date entered by a user in a variable. The variable that stores the lease start date should contain no value, by default. If no lease start date is entered, the variable should have no value assigned to it. Which code segment should you choose?
Options
- ADateTime? leaseStartDate = null;
- BDateTime leaseStartDate = null;
- CDateTime? leaseStartDate = new DateTime();
- DDateTime leaseStartDate = new DateTime();
How the community answered
(33 responses)- A70% (23)
- B3% (1)
- C18% (6)
- D9% (3)
Community Discussion
No community discussion yet for this question.