- Access modifier
protected internal
can block any third party code outside of the assembly from subclassing/overriding methods inside the assembly.
- equals
Object.ReferenceEquals()
can check reference equality when hashcode()/equals() have been overriden to compare object equality between two objects.
In java we can only check either object equality or reference equality, but not both.
- package/code organization
Project(module/library) name can be directly reused as the package/namespace name to save unnecessary package declaration/creation.
- pass by reference
c# allows program to pass variable by both value(out-parameter) and reference(in-parameter), whereas java only allows passing by value.
- object literals
in c# an array of double
can be created using literal syntax, whereas java doesn't offer these syntax.
double[] numbers = {1.1, 2.2, 3.0};