Appendix B. Comparing Java and C# keywords
Table B.1 shows the closest matching C# equivalents to the 49 Java keywords.
Java keyword | Closest C# equivalent | Comments |
---|---|---|
abstract | abstract | |
assert [3] | - | Use the Debug.Assert static method in C# instead |
boolean | bool | |
break | break | |
byte | sbyte | An sbyte is a signed 8-bit numeric simple type, while byte is an unsigned 8-bit numeric simple type in C# – Java's primitive types are all signed |
case | case | |
catch | catch | |
char | char | |
class | class | |
const* | const | This keyword is reserved in Java, but not used – in C#, const is used to declare a constant |
continue | continue | |
default | default | |
do | do | |
double | double | |
else | else | |
extends | - | In C#, : is used to denote class inheritance instead of using the extends keyword |
native |
Get From Java to C#: A Developer's Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.