بسم الله الر حمن الر حيم

 

Edisi: Compare;

           Terdapat berbagai macam bahasa pemrograman, masing-masing memiliki karakteristik, keunggulan dan kekurangan. Namun, dengan bijak kita harus menyikapi bahwa antara satu bahasa dengan bahasa lain itu saling melengkapi. Berikut ini adalah berbagai komparasi antar berbagai bahasa pemrograman, diantaranya adalah C# vs C++, C# vs Vb.Net danC# vs Java. Perbandingan yang dilakukan adalah menampilkan kata “Hello World”.

C# :

 

using System;

 

    class Program

    {

        static void Main(string[] args)

        {

            Console.WriteLine("Hello, World!");

        }

    }

C++ :

 

#include <iostream>

using namespace std;

static int main()

{

  cout << "Hello World!" << endl;

  return 0;

}

 

//======================== >>

 

C# Compared to C and C++ :

 

Memory is managed with a garbage collection system: there is no delete method to undo a call to new.

 

Header (.h) files are not used, or required. The information stored in header files is now stored as part of an assembly.

 

In a C# program, no semicolons are required after closing braces in a class definition.

 

The Main method is capitalized, and is a member of a static class. Main returns int or void.

 

Every program must have a Main method, or it will not compile.

 

The switch statement's break statement is not optional.

 

Conditions must be Boolean.

 

Default values are assigned by the compiler (null for reference types, 0 for value types).

VB.Net :

 

Module Module1

 

    Sub Main()

        Console.WriteLine("Hello, World!")

    End Sub

 

End Module

 

//======================== >>

 

C# Compared to Visual Basic :

 

Semicolons are used instead of line breaks.

 

C# is case-sensitive, for example, the Main method is capitalized.

 

Conditions must be Boolean.

Java :

 

class HelloWorldApp

{

    public static void main(String[] args)

    {

        System.out.println("Hello, World!");

    }

}

 

//======================== >>

 

C# Compared to Java:

 

The Main method is capitalized.

 

Boxing and unboxing convert between value and reference types: there is no need to create wrapper types.

 

A final class in Java is a sealed class in C#.

 

C# supports properties.

 

C# methods are non-virtual by default.

 

C# supports attributes for including extra information for the compiler.

Alhamdulillah, semoga bermanfaat,,,

About ifqo

Kepingin melawan arus, agar tidak tenggelam,,,

Tinggalkan Komentar/Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s