C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !



Posted By: R Sudha       Member Level: Gold       Posted Date: 07 Dec 2005       Category: C#

What is the difference between a read-only variable and a constant
declared in a class?



readonly variables declared as public readonly int x;
and constants declared as public const int c=99;


Select Answer:

Both are same
read only variables can be assigned different values using multiple constructors but not constants
Values of both cannot change once declared
Do not know




      
Your Test Score: 0 / 0



Next Question: Consider a declaration in a class. public const int c=99; This can be accessed in other classes by
Previous Question: Which of the following is true for a special member of the class namely 'this'
Related Questions:
  • In Object Oriented Programming, how would you describe encapsulation?


  • What’s the advantage of using System.Text.StringBuilder over System.String?


  • Which of the following is used to denote comments in C#?


  • In C#, the members inherited from the base class may not include which of the following?


  • If a method is marked as protected internal who can access it?


  • Categories

    ASP.NET C# VB.NET 
    .NET Framework SQL Server Other 

    Submit Interview/Test Questions with Answers and make money from adsense revenue sharing program

    Want to prepare for an interview? Try our aptitude tests and standard interview questions first.


    dotNet Slackers   BizTalk Adaptors    Web Design

    it support

    Contact Us    Privacy Policy    Terms Of Use