Appendix B. Comparing Java and C# keywords

Table B.1 shows the closest matching C# equivalents to the 49 Java keywords.

Table B.1. C# equivalents to Java keywords
Java keywordClosest C# equivalentComments
abstractabstract 
assert [3]-Use the Debug.Assert static method in C# instead
booleanbool 
breakbreak 
bytesbyteAn 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
casecase 
catchcatch 
charchar 
classclass 
const*constThis keyword is reserved in Java, but not used – in C#, const is used to declare a constant
continuecontinue 
defaultdefault 
dodo 
doubledouble 
elseelse 
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.