O'Reilly logo

From Java to C#: A Developer's Guide by Heng Ngee Mok

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required