Java vs. C# Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Determine whether a variable is castable to another.

A
Java: instanceOf
Object h = new Object();
h instanceof Object -> True
C#: is 
Object h = new Object()l
h is Object -> True
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Call a class’s base class method / member

A
Java: 
public MyClass( int a ) 
{
super( a );
}
C#: 
public MyClass( int a ) : base( a )
{
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Lock an expression / object to make it thread-safe

A

Java: synchronized( x )

C#: lock( x )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Create a scope to avoid name collisions, group like classes, etc.

A

C#: namespace

Java: package

How well did you know this?
1
Not at all
2
3
4
5
Perfectly