StudentShare
Contact Us
Sign In / Sign Up for FREE
Search
Go to advanced search...
Free

Critical Difference Between Java and C# - Essay Example

Cite this document
Summary
This essay "Critical Difference Between Java and C#" focuses on the language C# which is shown as a new-and-improved version of Java. In fact many of the actual classes and APIs in C# gain from the perception of Java more than C+. The two languages have many common features…
Download full paper File format: .doc, available for editing
GRAB THE BEST PAPER92.8% of users find it useful
Critical Difference Between Java and C#
Read Text Preview

Extract of sample "Critical Difference Between Java and C#"

Critical Difference between Java and C# The C# language is considered to be an object-oriented programming language that permits programmers to rapidly construct a wide range of functions for the Microsoft .NET platform. The objective of C# and the .NET platform is to cut down development time thus allowing developers to truly spend their time and strength working on their application and business logic instead of perturbing about other low level testing issues such as memory management, safety matters, building low level libraries, array bounds checking , etc.. At the same time as a Java developer the earlier sentence could be explained as ‘a short description of the Java language and platform’ instead the words C# and the .NET platform were replaced with words Java and the Java platform ( Obasanjo, 2007). C# is developed by Microsoft as part of the .NET initiative and later got consented as a standard by European Computers Manufacturing Association (ECMA) and International Organization for Standardization (ISO). The development of the C# language was led by Anders Hejlsberg and has a procedural, object-oriented syntax based on C++ and comprises features of several other programming languages with a special attention on simplification. C# is supposed to be a simple, modern, general-purpose, object-oriented programming language (Wikipedia, 2008). Java is another programming language basically developed by Sun Microsystems and released in 1995 as a most important element of Suns Java platform. This programming language receives most of its syntax from C and C++ and has a pure object model and fewer low-level facilities. Java usages are normally compiled to byte code which can run on any Java virtual machine (JVM) regardless of computer architecture. The basic and reference implementation Java compilers, and class libraries were progressed by Sun from 1995. In acquiescence with the specifications of the Java Community Process, Sun presented most of their Java technologies as free software under the GNU General Public License in May, 2007. Others too advanced alternative implementations of these Sun technologies, such as the GNU Compiler for Java and GNU Class path (Wikipedia, 2008). Java and C# are not the same.  There are some areas somewhere they are considerably dissimilar, and the execution of properties is one of those areas.  Hence, so as to be capable in both languages, one needs to know the dissimilarities in the way that properties are implemented in each of the two languages. For this purpose, there is a need to understand the implementation differences in few other areas also, such as event management and arrays. Even though there are dissimilarities in both programming languages it is easy to understand C# if one knows Java and easy to understand Java if one knows C# (Baldwin, 2008). The significant part of .NET is the new C# language, a new object-oriented programming language (OOPL) based on C++. Fundamentally C# is the first component oriented language in the C/C++ family. The distinctive aspects of the language such as having component concepts being first class members of the language could be one reason [to use C#] and the addition of language constructs that permit developers to be further supple and powerful would be another reason. It seems that C# has nothing to do with Java. However, C# owes a good amount of its devise to Java as it does to C++. Both languages have a common ancestry in C++. Obviously, C# benefits from the early success Microsoft had with Java. As a matter of fact, Java makes life simple by eliminating certain features from C++ (like pointers, operator overloading and templates), which created troubles for programmers in the past. One has to appreciate both programming languages for their unique strength, style ( Dragan, 2001) While C# has a set of competences alike to Java, it has additional many new features. Delegation is the capacity to treat a process as a first-class object. A C# delegate is used where Java developers would use an interface with a single method. The C# language is very similar to Java. It is because of the legal difficulties between Microsoft and Sun, there is little question that Microsoft would have selected Java to fill the task in its plans that is at present held by C#. The most important features C# has in common with Java comprise garbage collection, a virtual machine, single inheritance, interfaces, packages, and the fact that all code is encapsulated within objects. Since the developers of C# had the benefit of cautiously examining Java while developing their language, it is not astonishing that some of the differences attempt to tackle important problems that are difficult to deal with in Java. C# launches the idea of delegates, which correspond to processes that are callable without information of the target object. This approach represents an accomplishment of the Adapter pattern. (Gamma et al, 2003). It vary from a Proxy in that an Adapter maps a number of diverse methods into alike calls, permitting manifold objects implementing processes with different names but well-matched names to be used interchangeably. This can also work with or without a target interface to implement. The Delegated class makes easy and simplifies the steps in creating an Adapter. These delegates are easy to use, and a single delegate instance may be reused multiple times. At the same time an interface is known or can be created, readable way to pressurize a method into executing the actions in that interface. Common interfaces, such as Runnable and lots of event listeners may effortlessly be mapped to any identical public method. Such cases, the Java code is roughly as simple as the code that could be written using C#s built-in delegate construct. It is observed that delegates implementing interfaces are more useful than those using invoke. In Swing programming, where large numbers of Runnables are required to pass control to the swing thread, the capability to turn methods into Runnables is mostly helpful. Delegates permit to mainly remove the need for unidentified inner classes, improving the readability of the code (Lewis and Fitzpatrick, 2003). Properties may be a common perception to Delphi and Visual Basic users. The drive is for the language to honour the concept of getter/setter methods, which is a widely used pattern, mainly in Rapid Application Development (RAD) tools. Mostly for read/write properties, C# offers a cleaner way of managing this notion. The link between a get and set method is inbuilt in C#, whereas this has to be sustained in Java. It give confidence to programmers to think in the direction of properties, and whether that property is most natural as read/write vs. read only, or whether it actually shouldnt be a property at all. The language that supports properties will gather the benefits of that better abstraction. C# offers straight support for events. Even though event handling has been a primary part of programming ever since programming began, there has been astonishingly very minute effort made by the majority languages to formalize this theory. How todays mainstream frameworks manage events, there are examples like Delphis function pointers (called closures), Javas inner class adaptors, and certainly, the Windows APIs message system. C# makes use of delegates along with the event keyword to give a very clean answer to event management. In spite of the fact the Java version appears to convey more, but it is not, and is less type-safe, letting one to by mistake assign wall to any int value without the compiler complaining. One advantage of C# is the revelation someone find when debugging. Suppose the programmer put a break point on an enumeration which holds combined enumerations, it will automatically decode direction to give you a human legible output, rather than a number you have to decode. Nearly all languages have primitive types (int, long, etc), and higher level types which are eventually composed of primitive types. It is habitually useful to be able to treat primitive types and higher level types in the same way. For example, it is helpful to have collections which can take both ints in addition to strings. This achieved by sacrificing some competence and treating ints and longs as types like String or Form. Java tries to avoid sacrificing this competence, and treats primitive types like in C or C++, but offers related wrapper classes for each primitive. C# gives a diverse solution to this problem. The developers of C# must have well thought-out templates through their design process. There may be two reasons not using the template the first is complexity and they are difficult to work with reflection. The second reason is that templates may not be extremely useful unless the .NET libraries similar to the collection classes used them. However, the templates (generics) are being considered for addition in the Java language by the Java Community Process. Virtual methods agree to object oriented languages to convey polymorphism. In the sense a resultant class can write a method with the same name as a method in its base class, and the base class will call the derived classs method. All methods are virtual in Java. In C#, like C++, the virtual keyword has to be used so that the process will be called by the base class. In C#, it is also necessary that the override keyword is required to indicate that a method should override a process of its base class. Resolving versioning topics has been a main deliberation in the .NET framework. The majority of these considerations relate to assemblies. There are a number of quite remarkable capabilities such as running multiple versions of the identical assembly in the identical process. The C# language prevents software breakdown when new versions of code (most notably the .NET libraries) are made. The C# reference manual states that C# addresses this versioning problem by requiring developers to evidently state their intent. Even though the use of the word override is one way to state intention, it could also be automatically produced by the compiler by checking to see if a method performs (rather than declares) an override at the time of compilation. This explains one can still have Java-like languages which dont use virtual and override keywords and still manage with the versioning appropriately. The language Java simplified how parameters could be passed when one consider what C++ does. In C++, parameters of a method and a method call pass in values or references, which in addition of having pointers; can direct to unreasonably complex code. C# makes passing by reference unambiguous for both the method and the method call, which greatly lessen any confusion, thus accomplishing the same objective as Java, but with better eloquence. It is obviously a topic of C# to not hedge programmers into state of affairs where they require a round-about way of attaining something. Both languages C# and Java include data such as the access level of a field in the compiled code. C# simplifies this capability, so that one can compile custom information about any element of code such as a class, method, field and even individual parameters. This data can be retrieved at run-time. Java uses a mixture of /** */ and comments to comprise extra information about classes and methods, but this information is not built into the byte code. C# uses the pre-defined attributes Obsolete Attribute so the compiler can warn against obsolete code, and the Conditional Attribute to facilitate conditional compilation. Microsofts new XML libraries make use of attributes to convey how fields should be serialized into XML, which means one can simply turn a class into XML and then reconstruct it again. Yet another appropriate use for attributes is for the formation of a powerful class browsing tool. The C# Language Reference enlightens precisely how to build and use attributes. C# permits to administer a control statement with an integral type, char, enum or a string. In Java and C++ if one leaves out a break after each case statement there is a risk having another case statement being executed. In C#, the components can be organized as source-code (classes, structs, delegates, enums, etc.) into files, namespaces & assemblies. There are five access levels in C#, private, internal, protected, internal protected, and public. Private and public have the same meanings as in Java, noting that in C# the default access level is private, rather than package. Internal access is scoped to assemblies rather than namespaces which are more similar to Java. Internal protected access is equivalent to Javas protected access. Despite the naming similarity with C++, destructors in C# are much more like Java finalizers. This is since they are called by the garbage collector rather than clearly called by the programmer. Furthermore, like Java finalizers, they cannot be guaranteed to be called in all circumstances. If you are used to programming with deterministic finalization, then one has to adapt to a different model when moving to Java or C#. The model Microsoft suggests and implements throughout the .NET framework is the dispose pattern. In case of distributed programming, the .NET framework provides a leased based model to improve upon DCOM reference counting. The evaluation between [C#/IL Code/CLR] and [Java/Byte-Code/JVM] is an expected and suitable comparison to make. Through C and C++ programs, can normally compile the source code to assembly language code which is capable to run on a particular processor and a particular OS. The compiler needs to know what OS it is targeting, since OSs changes according to executables work and how they implement some basic C/C++ constructs for instance allocating memory. This C/C++ model has been very successful but has its limitations: Does not offer a program with a very rich interface to interact with other programs; does not permit a program to be distributed in a form which can be used as is on diverse platforms; Does not permit a programs execution to be limited to a sand box of secure processes. Java solved these problems before it by having Java compile to byte-code which then runs on a virtual machine. Byte-code sustains the basic formation of a program before it is compiled, hence making it possible for a Java program to interact with another program. Byte-code is as well machine-independent, which means the same class file can be used on a number of platforms. Lastly, the fact that the Java language did not have explicit memory management (via pointers) made it right to writing sand-boxed programs. Nowadays most Java Virtual Machines use a Just-In-Time compiler which essentially compiles to machine-code class frames just before they enter scope and method bodies just before they are implemented. It is feasible to change a Java program to assembly language before it runs to get rid of the overhead in start-up time and memory of a Just-In-Time compiler. The Java runtime will handle many critical parts of the programs execution such as garbage collection and security. This runtime is referred to as a controlled execution environment. The interoperability is divided into three divisions: Language interoperability, Platform interoperability, and Standards interoperability. Java has its essential strength in platform interoperability and C# has its strength in language interoperability. Both Java and C# have strengths and weaknesses in standards interoperability. The language interoperability is the level and ease of integration with other languages. Both the Java Virtual Machine and the Common Language Runtime permit to write code in many different languages. For example, an Eiffel or Visual Basic programmer could import a C# class, override a virtual method of that class, and the C# object would now use the Visual Basic method. The platform interoperability means OS interoperability, and over the last few years the internet browser has appeared as a platform in itself. C# code runs in a controlled execution background, which is the most significant technical step to making C# use on diverse operating systems. For the purpose of cross-platform projects that need additional complex client interface, Java is a good choice. The standards interoperability are all the standards like databases systems, graphics libraries, internet protocols, and object communication standards, that the language can access (Albahari, 2000). There is some criticism concerning the C# programs, the performance of all programs written for the .NET and other virtual machine environments, inclined to have additional system resources than functionally similar applications that making use of machine resources more directly (Dr. Dobbs Journal, 2005). The Platform for the reference .NET Microsoft implementation is only available on Windows, and their tie to this Operating system is observed by some as a disadvantage (Bjarne, 2007). Even though the C# language definition is standardized under an ISO standard, only a part of the Base Class Library, which contains the fundamental functions that are used by all C# programs (IO, User Interface, Web services ...) is also standardized. Over and above, parts of the BCL have been patented by Microsoft, which might dissuade non-Microsoft implementations of the full framework (Wikipedia, 2008). The language C# is shown as a new-and-improved version of Java. In fact many of the actual classes and APIs in C# gain from the perception of Java more than C++. The two languages have many common features, in addition to the objects and APIs have a direct, one-to-one correspondence. It can be shown that the C# team has borrowed some of the names of classes and APIs straight from Java. Of course, Java borrowed some of its names for APIs from C++, too. Microsoft has certainly elevated the interest for programming languages with C#, however this development is built exactly on the shoulders of the industrys four years of experience with Java. The developers of C# have obviously learned from Java, and also put back features from C++ which might have missed in Java. In conclusion one can say that the two programming languages are quite similar, and working developers and project managers with Java experience can be confident that even if C# takes over, since these individuals already know a good deal of C# from the expertise added from Java ( Dragan, 2001). References Albahari, B. (2000) A Comparative Overview of C# [Online] Genamics/Developer Available from [06 January 2008]. Baldwin, R.G.(2008) Understanding Properties in Java and C# [Online] Navigate developer.com. Available from [06 January 2008]. Dragan, R.V. (2001) Java vs. C#, a Code-for-Code Comparison [Online] ExtremeTech Available from [06 January 2008]. Gamma, E. et al (1994) Design Patterns: Elements of Reusable Object-Oriented Software. Addison Wesley Professional Computing Series. Lewis, S. and Fitzpatrick, W. (2003) A Java Programmer Looks at C# Delegates [Online] Available from [06 January 2008]. Obasanjo, D. (2007). A Comparison of Microsofts C# Programming Language to Sun Microsystems Java Programming Language [Online] Available from [06 January 2008]. Wikipedia, (2008).C Sharp[Online] Wikimedia Foundation, Inc., Available from [06 January 2008]. Wikipedia, (2008). Java (programming language) [Online] Wikimedia Foundation, Inc., Available from [06 January 2008]. Read More
Cite this document
  • APA
  • MLA
  • CHICAGO
(“Critical diference between java and C# Essay Example | Topics and Well Written Essays - 2500 words”, n.d.)
Critical diference between java and C# Essay Example | Topics and Well Written Essays - 2500 words. Retrieved from https://studentshare.org/miscellaneous/1543974-critical-diference-between-java-and-c
(Critical Diference Between Java and C# Essay Example | Topics and Well Written Essays - 2500 Words)
Critical Diference Between Java and C# Essay Example | Topics and Well Written Essays - 2500 Words. https://studentshare.org/miscellaneous/1543974-critical-diference-between-java-and-c.
“Critical Diference Between Java and C# Essay Example | Topics and Well Written Essays - 2500 Words”, n.d. https://studentshare.org/miscellaneous/1543974-critical-diference-between-java-and-c.
  • Cited: 0 times

CHECK THESE SAMPLES OF Critical Difference Between Java and C#

Critical Reflection on the Modules

Information systems in the term used to mean the interaction between people in an organisation, data, processes and technology.... This paper ''critical Reflection on the Modules'' is about the module brought into perspective the foundation of web applications development using HTML and CSS.... It presents a critical reflection of all the modules I undertook in my first academic year during both the first and the second semesters.... PART 1: critical Reflection on the Modules Semester 1 Modules Website development This module brought into perspective the foundation of web applications development using HTML and CSS....
11 Pages (2750 words) Personal Statement

Prenatal Hormone Difference

Prenatal hormone difference Customer Inserts His/ Her Name Customer Inserts Grade Course Customer Inserts Tutor's Name (27, 04, 2012) Outline 1.... Conclusion Prenatal hormone difference 1.... This essay will discuss how females who have been exposed to high testosterone prenatally demonstrate notable difference in behavior and cognition that females who have not been exposed to testosterone....
4 Pages (1000 words) Essay

Interactive Virtual Tour Technology

Then the panorama is coded using a browser plug-in or a java runtime engine to make it interactive, after which it is installed on the web for users to view.... Some for beginners and hobbyists and others for professionals, the difference in complexity, ease of use and price....
18 Pages (4500 words) Assignment

Distributed Systems

It allows us to implement RPC style applications in java.... In fact, it's a technology which is native to java.... RMI implements marshaling through serialization feature of the java language.... Both the ends are in java Serialization.... ) The major drawback it holds is that, RMI only works where both server and client side programs are implemented in the same language that is java.... RMI implements marshaling through serialization feature of the java language....
5 Pages (1250 words) Essay

History of Programming

This essay talks about the history of programming with more emphasis on developments since the arrival of electronic computers in the 1940s.... The paper reviews the history factors which brought about the change, types of programming that took place in various periods.... ... ... ... However, the history of programming is related and studied more in relation with computing and how the two segments of the technology industry, computer hardware and associated programming languages, developed in parallel....
8 Pages (2000 words) Essay

Information Security of Java and NET

The paper "Information Security of java and NET" describes that both platforms and development environments offer their advantages and disadvantages to users as well as programmers and it remains up to the individual programmer or the company itself to select one or the other.... Security and the related configurations for both java and .... Security does not seem to be a paramount concern because java and .... ET, the GUI can be used to adjust all security configurations much as the GUI tool supplied with java....
11 Pages (2750 words) Research Proposal

Indonesian Forest Degradation and Deforestation

The paper "Indonesian Forest Degradation and Deforestation" discusses that degradation and deforestation in Indonesia have largely been due to corrupt economic and political systems which have misused the lucrative gains of the forests for personal and political gains.... ... ... ... A large number of wood-processing industries recognize and acknowledge their reliance on illegal logging to meet their customer demand....
17 Pages (4250 words) Research Paper

Critical Appraisal of Antimicrobial Resistance

The paper "critical Appraisal of Antimicrobial Resistance" focuses on the critical analysis of providing an insight into the causes of antibiotic resistance and how effective interventional strategies can be developed.... Antimicrobial resistance is therefore a critical concern, specifically because it has the potential to lead to difficulty in disease control.... This prompts the need for critical appraisal of the literature on causes of antimicrobial resistance and possible interventions, hence the rationale for the research question: What interventional strategies can effectively control antibiotic resistance?...
10 Pages (2500 words) Research Paper
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.
Contact Us