SyntaxFix
Write A Post
Hire A Developer
Questions
🔍
[c#] What is the equivalent of Java's final in C#?
Home
Question
What is the equivalent of Java's final in C#?
It depends on the context.
For a
final
class or method, the
C# equivalent is
sealed
.
For a
final
field, the
C# equivalent is
readonly
.
For a
final
local variable or method parameter, there's no direct C# equivalent.
Examples related to
c#
•
How can I convert this one line of ActionScript to C#?
•
Microsoft Advertising SDK doesn't deliverer ads
•
How to use a global array in C#?
•
How to correctly write async method?
•
C# - insert values from file into two arrays
•
Uploading into folder in FTP?
•
Are these methods thread safe?
•
dotnet ef not found in .NET Core 3
•
HTTP Error 500.30 - ANCM In-Process Start Failure
•
Best way to "push" into C# array
Examples related to
access-modifiers
•
What is the default access modifier in Java?
•
What is the difference between Dim, Global, Public, and Private as Modular Field Access Modifiers?
•
Internal vs. Private Access Modifiers
•
Class is inaccessible due to its protection level
•
What are the default access modifiers in C#?
•
What is the equivalent of Java's final in C#?
•
What are public, private and protected in object oriented programming?
•
In C#, what is the difference between public, private, protected, and having no access modifier?
•
What is the difference between 'protected' and 'protected internal'?
•
What is the difference between public, protected, package-private and private in Java?
Examples related to
reserved-words
•
Syntax error due to using a reserved word as a table or column name in MySQL
•
What is the equivalent of Java's final in C#?
•
How do I escape a reserved word in Oracle?
•
What does the @ symbol before a variable name mean in C#?