answersLogoWhite

0


Best Answer

Default access specifier in c# is private.

if you don't specify it automaticaly takes it as private.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is a default access specifier for variable in c sharp?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is boolean in C Sharp?

A boolean is a variable type that can only be two different values True or False same as it is in most programming languages but in C# booleans are stated as: public bool var = True; or public bool var = False;


When was A Box Full of Sharp Objects created?

A Box Full of Sharp Objects was created in 2002.


What does the 'does not exist in current context' error mean in c sharp?

It means you are trying to modify an entity from outwith the scope of that entity. The following shows an example: public void button1_Click(object sender, EventArgs e) { int x = 42; timer1.Start(); } public void timer1_Tick(object sender, EventArgs e) { if (x==42) // error: x does not exist in current context { // do something... } } Here, the x variable is declared local to the button1_Click event. That is; it is scoped to that function and is only accessible within the context of that function. The timer1_Tick event is a separate function, outwith the scope of the button1_Click event. As such, the timer1_Tick function cannot access x. In order for both functions to access variable x, that variable must be declared in a scope that is accessible to both functions. Given that both functions are members of the same class, it would make sense to declare x at class scope: int x = 0; public void button1_Click(object sender, EventArgs e) { x = 42; timer1.Start(); } public void timer1_Tick(object sender, EventArgs e) { if (x==42) { // do something... } } Note that the point of declaration defines the scope of the declared entity and that the scope defines the context in which that entity is visible.


What are some sharp objects?

Examples: knife, sword, ax, guillotine, blade, razor, scalpel, scissors etc.


Does c sharp work on c or c plus plus compilers or you need a c sharp compiler?

They are different languages, each of them requires its own compiler.

Related questions

What is a default access specifier for the class and method and variable in c sharp?

Depends on the context of the declaration.Consider the following codeclass DefaultComponent {int _x;void DoSomething(){}//nested class, similar to DefaultComponentclass Inner {int _y;void DoAThing() {}}}Except DefaultComponent being internal, anything else are private, including the class Inner! That is, if the above code being copy exactly without modification and paste into another class as another nested class, the access of DefaultComponent now changes to private.


What programming languages may be used to write applications for an Access Database?

The default language for Access applications is VBA (Visual Basic for Applications). With most of the languages C, C Sharp, and the proper references attached one can create application that talk to the Access engine. Proud to be of service HoloGuides.com


What is variable ratio power steering?

This allows you to have some freedom in your steering. You can make some changes and even sharp turns if necessary.


Do concave mirrors reflect sharp images?

It depends on the precise shape of the mirror. What's generally meant by "sharp image" is that the light rays focus at a single point. If the curvature of the mirror is variable, this doesn't happen.


What are different access specifiers in c sharp?

public private internal protected internal protected


Where can I access a free online user manual for a Sharp FX?

You can download your free online Sharp FX manual at www.manualusersguide.com. They will tell you everything about the phone from how much it weighs to operating and wi-fi.


How do you access the menu on a sharp linytron model 1371m without remote?

Look for the menu button on the manual control pushbuttons.


If sharp is not sharp and not sharp is sharp then What is half-sharp?

Half- sharp


What is coding of swaping of two numbers without using third variable in c sharp?

// Arithmetic method a = a + b; b = a - b; a = a - b; // XOR method a = a ^ b; b = a ^ b; a = a ^ b;


What are the notes in the d minor melodic scale?

UP: d sharp e sharp f sharp g sharp a sharp b sharp c double-sharp d sharp DOWN: d sharp c sharp b natural a sharp g sharp f sharp e sharp d sharp


What are the notes to?

A sharp G G E sharp G E sharp A sharp A sharp C C A sharp C E sharp G A G E sharp A sharp A sharp A sharp G E sharp C this is not on the Flute btw idk what instrument its on


What are the notes to fireflies?

A sharp G G E sharp G E sharp A sharp A sharp C C A sharp C E sharp G A G E sharp A sharp A sharp A sharp G E sharp C this is not on the flute btw idk what instrument its on