Prepare
Practice
Interview
Aptitude
Reasoning
English
GD
Placement papers
HR
Current affairs
Engineering
MCA
MBA
Online test
Login
Online Practice Test
>
Csharp.NET
« Previous
Next »
Features of readonly variables
Options
- It is allocated at compile time
- Declaration and initialization can be separated
- It is initialized at run time
- all of these
CORRECT ANSWER : all of these
Discussion Board
Hint is in the first line
The question would be easier if the options used the phrase 'can be' (but testers don't have to make questions easy). The hint is 'Features of' in the first line.
A readonly variable can be assigned a value inline (or not).
A readonly variable can be assigned a value in the constructor (value not known until runtime).
The above therefore gives you separation of declaration and initialization.
Ackroydd 04-19-2015 11:00 AM
Incoherence between A and C
Actually if you say it can be allocated at compile time, then you are assuming it must be at runtime also. But the problem in here is HOW. I personally agree with B, but at compile time, depending on the IDE, the compiler is just accomplishing grammar and token variations but it is not really allocating nothing. Now, if you are debugging and/or running code, then your allocating because you creating the values and objects.
Am I right? If not please answer back.
Yeinier 01-19-2015 08:10 PM
Problems with Read only question
The term is readonly, not read only.
All of the above, the correct answer cannot be correct when A and C are mutually exclusive. I believe C should be it is initialized at run time. It currently say allocated.
Jeff Walker 12-15-2013 03:20 PM
Partial error in question
I think 'b' should read:
Declaration and initialization CAN BE separated.
http://msdn.microsoft.com/en-us/library/acdd6hb7.aspx
Andrew Cope 10-26-2013 03:42 AM
« Previous
Next »
Write your comments
*
*
Email must be in the form someone@domain.com
*
*
Enter the code shown above:
Please enter the code shown above
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)
Related Content
ASP.NET (41)
ASP.NET (16)
ASP.NET (16)
ASP.NET for Freshers (19)
ASP.NET for Experienced (19)
ASP.NET (20)
ASP.NET (20)
ASP.NET (25)
ASP.NET (20)
ASP.NET (20)
ASP.NET (20)
ASP.NET (20)
Dot.Net (100)
.NET Framework (26)
.NET Caching (7)
.NET Remoting and webservices (10)
.NET Security (11)
ADO.NET (10)
C#.NET (25)
VB.NET (33)
DOT.NET (10)
C#.NET freshers (20)
C#.NET freshers (20)
C#.NET experienced (20)
C#.NET (25)
C#.NET (20)
Sharepoint (20)
Sharepoint 2007 (15)
WCF (50)
WPF (45)
Advertisement
▲