www.pickatutorial.com Computer Tutorials
Top eBooks: C/C++ | C# | Android | Mathematics | Database | Cloud | Graphics | Networking | Oracle | Hardware | AI
Top Tutorials: C/C++ | C#.NET | PHP MySQL | Java | Java Script | jQuery | HTML | xHTML | HTML5 | VB Script| CSS
Lessons C#: Similarities with Java Bookmark and Share
Tutorial Home
Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Lesson 9
Lesson 10
Lesson 11
Lesson 12
Lesson 13
Lesson 14
Lesson 15
Lesson 16
Lesson 17
Lesson 18
Lesson 19
Lesson 20
Lesson 21
Lesson 22
Lesson 23
C#, C++ and Java are very similar in nature. For example the basic syntax of all of the three languages is almost identical.

The focus of this lesson will be on the major similarities of Java and C#.
  • C# and Jave both compile into a machine independent code, which then runs in a managed execution environment. In other words both C# and Java compile initially to an intermediate language. In the case of C# it is called as Microsoft Intermediate Language (MSIL), and in the case of Java it is known as Java bytecode. In each case the intermediate language is run by interpretation or just-in-time compilation - on an appropriate 'virtual machine'. Java bytecode is run by JVM and the MSIL is run by the CLR.
  • Both languages have powerful reflection capabilities.
  • Both of these support only OOP and all classes descend from the Object class.
  • Both of these have garbage Collection coupled with the elimination of pointers. In C#, however, restricted use of pointers is permitted within code marked as unsafe.
  • Unlike C or C++, in Java and C# there are no header files. All code is scoped to packages(Java) or assemblies(C#).
  • Unlike C++ there is no problem in declaring one class before another with circular dependencies.
  • Objects must be allocated on the heap with the use of the new keyword.
  • Both support concurrency through thread support by putting a lock on objects when entering code marked as locked / synchronized.
  • Both have single inheritance and support for interfaces.
  • There are no global functions or constants, everything belongs to a class.
  • There is built-in bounds checking of Arrays and strings.
  • The "." operator is always used and there are no more -> and :: operators.
  • All values must be initialized before use.
  • Integers cannot be used as boolean.
  • In both languages try blocks can have a finally clause.

Next >>> Lesson No. 3: C#: Differences with Java

Home - Advertise - Contact - Disclaimer - About Us
© Since 2006 pickatutorial.com -- All Rights Reserved.