| Related sites for http://www.csharphelp.com/archives/archive96.html |
| NetSpun_Multimedia_Design Specializing in Macromedia, Adobe, and Sound Forge. | | DigiGroove New Mexico based designer offering affordable flash and multi-media design for delivery over the internet or on CD. | | Fibre_Channel,_SCSI_and_You A preview of Fibre Channel performance. | | Lupine_Partners Specializing in marketing and implementing information system solutions to real estate communities using MRI. | | Real_Edge Create custom CMAs, buyer home tours, flyers and run MarketShare/Recruiting for management. | | Wikipedia__Croquet_Project Encyclopedia article, with links to many related topics. | | ITtoolbox_MS_Exchange_Discussion_Group ITtoolbox MS Exchange Discussion Group offers functional and technical discussion of Microsoft Exchange products. | | Sid_Tune_Information_List_(STIL) Additional information about HVSC's SID tunes, such as cover information, interesting facts, useless trivia, and comments on the tunes by the composers themselves. | | CGI_Scripts_in_Pascal Pascal unit and examples for writing CGI scripts in Borland's TP7. | | 1st_Class_GradeBook [Win] Easy to use, grade management program offering a variety of reports and graphs. Trial version available. | | Promoplant Offers web design. | | Tulsa_Ruby_Workshop For users of other dynamic (or less dynamic) languages who want to learn about Ruby. First event is 26 April 2008, Hardesty Library, Tulsa, Oklahoma, USA. (April 26, 2008) | | ObjectForce_Software Produces and markets a suite of PowerBuilder development tools. | | University_of_Strathclyde Department of Computer Science. Research groups: Algorithms problems empirical studies; Software engineering; High performance information systems; Advanced use of computers in education; Hi | | SiberSafe_XML XML content management system that enables reuse, publishing, versioning, translation, indexing, search and fragmentation of XML content. | | Fletchweb_Design Offers design for family and small businesses. Located in Scotland. | | Spicebird Personal information manager based on Mozilla Thunderbird's code developed by an Indian company called Synovel. It provides e-mail, calendaring and instant messaging and also works as a newsgroup clie | | The_Great_E-scape Offering web site design, hosting, promotion, computer consulting, and custom software design. | | Original_Icons Large collection of AIM Buddy Icons | | Upas_mail_system Upas: a simpler approach to network mail by David L. Presotto. |
|
Java And C-Sharp Compared body { font-size:10pt; color: #000000; font-family: Verdana, Arial} .smallblack { font-size:10pt; color: #000000; font-family: Verdana, Arial} .smalltitle { font-size:10pt; color: #000000; font-family: Verdana, Arial} .smallwhite { font-size:10pt; color: #ffffff; font-family: Verdana, Arial} .smallred { font-size:10pt; color: #ff0000; font-family: Verdana, Arial} .small { font-size:10pt; font-family: Verdana,Arial} .smallest { font-size:8pt; font-family: Verdana,Arial} .smallestwhite { font-size:8pt; color: #ffffff; font-family: Verdana, Arial} .smallestblack { font-size:8pt; color: #000000; font-family: Verdana, Arial} .PhorumBodyArea { font-family: Verdana, Arial, Clean, Helvetica, sans-serif; font-size: 12px; width: 500px;} .PhorumListTable {border-style : solid;border-color : Black;border-width : 1px;} .PhorumListRow {font-family: Verdana, Arial, Clean, Helvetica, sans-serif;font-size: 12px;height: 21px;} .PhorumListHeader {font-family: Verdana, Arial, Clean, Helvetica, sans-serif;font-size : 14px;font-weight : bold;height: 24px;} .PhorumForumTitle {font-family: Verdana, Arial, Clean, Helvetica, sans-serif;font-size : 24px;font-weight: bold;} .PhorumTableHeader {font-family: Verdana, Arial, Clean, Helvetica, sans-serif;font-size: 12px;font-weight: bold;} .PhorumNav { font-family: Geneva, Verdana, MS Sans Serif , Clean, sans-serif;font-size: 10px;} .PhorumNewFlag {font-family: Geneva, Verdana, MS Sans Serif , Clean, sans-serif;font-size: 10px;color: Red;} .PhorumMessage { font-family: Courier New, Geneva, Courier, Clean;font-size: 12px;} .iTt{ FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 11px; FONT-STYLE: normal; FONT-WEIGHT: normal; COLOR: black; BACKGROUND-COLOR: lightyellow; BORDER: black 1px solid; PADDING: 2px; } Search Forum(53671 Postings) Search Site/Articles Printable VersionJava And C-Sharp ComparedBy Anand Narayanaswamy Ever since the advent of the internet, Java has been the target for many developers. Many C++ developers migrated to Java within a short period of time. Many high quality multithreaded animations, games, distributed applications are being developed and implemented successfully. Moreover the Java language is completely Platform Independent. Java Programs called Applets are verified for security in user's machine before downloading, thus ruling out the possibility for any viruses creeping into the user's machine. Many new advancements like swing package, Java2D API, Networking packages (java. net) have been built into the language after the initial release of Java Development Kit. Since Java is from Sun Microsystems many of its rival companies have started creating an alternative to this hot programming language, some two years back. Now a company which needs no further introduction, Microsoft have come up with a technology called Microsoft. NET. One of the prime languages in the .NET family is C# or C-sharp. This language was derived from Java/C++. Technically from my experience with C# for over six months, I am of the opinion that C# is more or less similar to Java. But many of the features of C++ like operator overloading (which was removed from Java) are there in C#. Java programs will run on any platform having Java Virtual Machine or JVM installed on it. But .Net programs targets platforms having Common Language Runtime or CLR. This is the runtime which is being used by all the .Net languages for the execution. Thus one .Net language can call the modules and functions written in another .Net Language. Further if you learn a language like C#, then it is very easy to learn other .Net languages because all .Net languages follow what Microsoft calls .Net Framework. This Framework includes all the necessary class libraries to build and deploy robust .Net applications. With .Net you can perform server side programming via ASP.Net, much like servlets in Java. Like Applets in Java, C# introduces WinForms and WebForms. With WinForms you can design and develop windows based applications and with WebForms you can develop applications for the Web. This can be achieved either through code with C# or by using development environment tools like Visual Studio.Net. It includes Visual C# with which you can build C# applications very easily and with minimum effort. WinForms is almost similar to win32 applications which we develop using Visual C++. It is possible to develop these applications using C++. But VC++ simplifies our development effort by providing us with wizards. Now Visual C# is also doing the same work. So if you are already a VC++ developer, it will be better for you to try out VC#. Comparing a Java program with C# program. It is worth to compare a program written in Java with that of C#. We will then discuss the major differences involved in both programs. Hello Java Program class Hello { // class declarationpublic static void main(String args[]) { // main method, entry pointSystem.out.println("Hello Java"); // prints Hello Java to the console }} Hello C# Program using System; // System namespace calledclass Hello { // class declarationpublic static void Main () { // main method, entry pointconsole.writeLine("Hello C#"); // prints Hello C# to the console } } In Java, the lang package is automatically imported. It is not necessary to import this package in simple programs. But in C# we have to call the namespace System in all programs. Please note that console is a class under the System namespace. Try out the above program and observe the output. Other Notable Differences Main Method Java: It is possible to compile a Java program without a main method, provided that class is used as a super class. However the program will execute only when there is a valid main method in the class. C#: It is not possible to compile a C# source file without a valid main method. If it is absent, then the compiler will show an error message like program 'filename.exe' does not have an entry point defined. Inheritance Both Java and C# doesn't supports multiple inheritance and provides interfaces as an alternative to it. However C# covers much more advanced issues in interfaces. Please check out the topic titled New Additions given at the end of this article. Operators and control flow statements: All operators like Arithmetic, logical, increment and decrement etc available in Java are supported by C#. Moreover control flow statements like if, else, if-else, for, do-while, while etc included with Java are also available in C#. However C# reintroduces the popular GoTo statement found in C++. Exception Handling: You can handle runtime errors also called as Exceptions in C# by making use of try, catch, finally, throws clauses. Exception handling in C# is almost same as in Java except some minor differences. System.Exception namespace is the base class of all the exception classes in C#. Multithreading: The application of Multithreading in C# is much more simplified, than in Java. We can synchronize threads by making use of the Monitor and Mutex classes. New Additions The concept of Indexers, Attributes and Delegates are new to C#. Indexers are almost similar to Vectors in Java. A complete discussion related to these new concepts are beyond the scope of our discussion. However I will try to explain these at an another occasion through this site. C# introduces the concept of operator overloading, which was not present in Java. However both Java and C# supports Method overloading and Method overriding. Coming back to interfaces, we can verify whether the methods included within an interface are implemented by using is and as operators. There are ways to avoid name ambiguity while implementing the interface methods. You can even combine two interfaces into one and implement that combined interface in a class like the following piece of code using System;public interface First { void A(); void B();}public interface Second { void C();}public interface Combined: First, Second { }class Combineimple: Combined {// statements goes here// main method goes here} } Further C# compiler shows the compile time error messages along with their error numbers. You can search the online documentation that comes with the SDK for the error number to study the cause of the error in detail. |
|