Posts

Showing posts from May, 2016

C# vs Java Programming Construct

Image
Programming Construct Both programming language makes use of constructs in controlling the flow of the execution of a program based on whether a certain condition is satisfied or not. They both make use of the selection, looping and branching constructs.  Selection construct - which executes a particular block based on a Boolean condition, example of selection construct similar in both languages are: if, if… else, switch…case constructs.  If selection construct   int num = -4;  if (num < 0)  {   Console.WriteLine(“The number is negative”);  }  Looping construct - which enables you to iteratively or repeatedly execute a single statement or a block of statements,example of looping construct similar in both C# and Java are: while, do...while, for, enhanced for looping construct.  public int val = 1;  while (val <= 10)   {    Console.WriteLine(num);    val++;   }  }  Branching construct - These are used to transfer control from one point in a program  to another, example

C# vs Java: Variables and operators cont'd

Image
COMPARISON TABLE  Expressions and operators     Java     C#  Arithmetic operators                Yes      Yes  Logical operators                     Yes      Yes  Bitwise logic operators             Yes      Yes  Conditional                             Yes Yes  String concatenation                    Yes      Yes  Casts                                      Yes      Yes  Boxing                                      Yes; implicit   Yes; implicit  Unboxing                                 Yes; implicit   Yes; explicit  Lifted operators                     No      Yes  Overflow control                      No      Yes  Strict floating point evaluation************ Yes; opt-in/out   No  Verbatim (here-)strings             No      Yes  Userdefined value-types*             Yes; struct    No  boolean data-type               boolean     bool  Contextual keywords**              No       Yes  Static initializaton block***            Yes      No  Implicitly typed variables*****   

Differences between C# and Java cont'd -- Variables and operators

Image
Variables and Operators Data Types   Brief Similarity on variables and operators   Both C# and Java are Type-Safe Languages   Java and C# were designed to be type-safe. An illegal cast will be caught at compile time if it can be shown that the cast is illegal; or an exception will be thrown at runtime if the object cannot be cast to the new type. Type safety is therefore important because it not only forces a developer to write more correct code, but also helps a system become more secure from unscrupulous individuals. Unified type system  Both languages are statically typed with class-based object orientation. In Java the primitive types are special in that they are not object-oriented and they could not have been defined using the language itself. They also do not share a common ancestor with reference types. The Java reference types all derive from a common root type. C# has a unified type system in which all types (besides unsafe pointers[12]) ultimately derive from

Comparison table of C# and Java

Image
  Native interoperability  Native interoperability                                   Java          C#  Cross-language interoperability                     Yes           Yes  External/native methods                                 Yes           Yes  Marshalling External glue code required      Yes           metadata controlled  Pointers and arithmetics*****                        No            Yes  Native types                                                    Yes           Yes  Fixed-size buffers                                            No            Yes  Explicit stack allocation                                  No            Yes  Address-of                                                        No            Yes  Object pinning (fix variable to address)          No            Yes   Metadata  Metadata                                                           Java          C#  Metadata         annotations/attributes Interface based;   user-defined annotations can be

I am confident

Image
I am confident Yeah right

Application Development in Java and C#

Image
Brief similarity  Both C# and Java Are Object-Oriented Languages Both C# and Java are designed from the ground up as object-oriented languages using dynamic dispatch, with syntax similar to C++ (C++ in turn derives from C). Neither language is a superset of C or C++, however, any class in either language implicitly (or explicitly) subclasses an object. This is a very nice idea, because it provides a default base class for any user-defined or built-in class.  Covariance and contravariance Covariance and contra variance is supported by both languages. Java has use-site variance that allows a single generic class to declare members using both co- and contravariance. C# has define-site variance for generic interfaces and delegates. Variance is not supported directly on classes but is supported through their implementation of variant interfaces. C# also has use-site covariance support for methods and delegates.  Garbage Collection  Garbage collection which simply is automatic

LOL

Image
Its too late The bugging
Image
On your mark!

C# and Java Language History and Evolution

Image
This post will describe C# and Java language history and evolution  C#  Microsoft earlier implemented a modified version of Java, which was called J++ and a modified version of the Java Runtime Environment (JRE). In 1997, Sun Microsystems sued Microsoft, stating that Microsoft added new features in a manner that contravened Sun's standards and conventions for Java platform neutrality, and which features therefore violated the license agreement between Microsoft and Sun. The suit was settled in 2001: Microsoft agreed to pay Sun $20 million and gradually phase out the Microsoft JRE over seven years.  At time of the settlement Microsoft had already revealed the first version of C# which was based on .NET as opposed to the JRE. While developing C#, Anders Hejlsberg's team at Microsoft studied a number of existing languages including C++, Java, Modula-2, C and Smalltalk. The most notable differences was the C# support for delegates and events, metadata attributes/annotation

Learn about the differences between C# and Java.

Image
C# and Java.  I have decided to evaluate the comparisons and contradictions of two high-level programming languages, this will provide s pecific differences, similarities behind the language syntax including comparison tables with side-by-side keyword analysis, code snippets with detailed explanations, this post with the new post will provides significant assistance as a developer.  This will be my introductory post on this topic  Getting Started with C#  C# was created in 2002 by Microsoft as a programming which was object-oriented, provides familiarity to programmers coming from C or C++ background and also which can create interoperable, robust and scalable applications targeting both desktop and mobile platforms. C# is built using the Microsoft .NET Framework which is a software framework designed to run on Windows operating system. The Microsoft .NET Framework contains a large set of utilities that manage the execution of programs written specifically for th
Image
I found the mouse