I don't know much about C# but I've been programming in Java for a few months now. I had always heard what C and C++ were, but was a little curious about where C# came from. I'm a little confused about the C# language since even though it's one of the 'C' languages (C, C++, C#), on the other hand all of my professors seem to line it up against Java, and not the others.If anyone can clarify that would be great :)
Why is there usually a reference to Java when when people talk about C#?
java;c#
Probably because Java and C# are extremely similar: They are both class-based OOP languages with single inheritance and interfaces, strong static typing, garbage collection built into the language, copy semantics that bind to types (value types vs. reference types), generics, namespace hierarchies, reflection, and they both run on a virtualized environment (JRE / .NET runtime). They also share a large part of their syntax.The other languages from the C-like family are different from both Java and C# in many regards: C doesn't have classes, it is weakly-typed, it does not have garbage collection, copy semantics are explicit on use, it compiles directly to machine code, and it lacks generics (offering C Preprocessor macros and implicit casts instead). C++ does have classes, but uses multiple inheritance instead of interfaces; it also offers templates, which are superficially similar to generics but work differently under the hood; it is similar to C in most other regards. Javascript, also very similar to C in its syntax, shares garbage collection and a virtualized environment with Java and C#, but it uses dynamic typing, prototype-based OOP, and it does not use the half-way compilation approach of Java and C#.