New course! Every coder should learn Generative AI!
Try a free lesson0
What's the difference between Java and C#?
I'm curious, my first programming lang was (and is) C#, Java is very simillar to C#, but I want to know the difference.
1 Answer
+ 1
stackoverflow.com/questions/295224/what-are-major-differences-between-c-sharp-and-java
Main:
1) All methods in Java are virtual by default
2) Java doesn't have operator overloading
3) There are no structs in Java
4) Java has advanced enums
5) There is no const qualifier in Java (but it has final - like a sealed + const in C#)
6) Java doesn't have preprocessor directives
7) Java doesn't have partial types
8) Java doesn't have extension methods
9) Java doesn't have internal and protected internal access modifiers. C# doesn't have default access modifier
10) Java doesn't have properties
11) Java doesn't have unsigned types
12) You cannot write unsafe code in Java (C++ pointers and manual memory allocation)