This course - C# and Java Keyword Comparison

last updated: 08/07/2006

There are ~76 reserved keywords in C# 2.0, and ~55 in Java 1.5.

C#

Java

C#

Java

C#

Java

C#

Java

abstract

abstract

explicit

---

object

---

this

this

--- assert

extern

native

operator

---

throw

throw

as

---

false false

out

---

---

throws

base

super

finally

finally

override

---

---

transient

bool

boolean

fixed

---

params

---

true

true

break

break

float

float

private

private

try

try

byte

byte

for

for

protected

protected

typeof 2

---

case

case

foreach

---

public

public

uint

---

catch

catch

get 2

---

readonly

---

ulong

---

char

char

goto

goto1

ref

---

unchecked

---

checked

---

if

if

return

return

unsafe

---

class

class

implicit

---

sbyte

byte

ushort

---

const

const1

in

---

sealed

final

using 3

import

continue

continue

int

int

set 2

---

virtual

---

decimal

---

interface

interface

short

short

void

void

default

default

internal

protected

sizeof

---

volatile

volatile

delegate

---

is

instanceof

stackalloc

---

while

while

do

do

lock

synchronized

static

static

:

extends

double

double

long

long

---

strictfp

:

implements

else

else

namespace

package

string

---

   

enum

enum

new

new

struct

---

   

event

---

null

null

switch

switch

   

1 Although goto and const are Java language keywords, they are unused in the Java language.

2 Although get and set are not actually reserved keywords--they are accessors typeof is not actually a keyword--it is an operator.

3 The using keyword in C# has two completely different uses, as a directive (like Java's import) and as a statement (which defines a temporary scope).


Visitors: Hit Counter