Activity Stream
48,167 MEMBERS
6824 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 10 of 10
  1.     
    #1
    Member

    Default C# Basics I - Classes in C#

    Classes in C#

    Consider the following code example, which defines a class:

    Code: 
    public class Hello
    {
         public static void Main(string[] args)
         {
         System.Console.WriteLine("Hello, World! \n");
         }
    }
    The preceding class declaration provides a method Main() that will display the message Hello, World! on your screen. The parts of the preceding code need to be examined.

    The Main() Function

    The first line of code that a C# compiler looks for in the source file compiled is the Main() function. This function is the entry point of the application.
    The Main() function is ideally used to create objects and invoke member functions.

    The class Keyword

    The class keyword is used to declare a class. Keywords are reserved words that have a special meaning. Here, the class keyword defines the class Hello. The braces, known as delimiters, are used to indicate the start and end of a class body.

    Example:

    Code: 
    class Hello
         {
              ...
         }
    The Class Name

    The class keyword is followed by the name of the class. In the preceding example, Hello is the name of the class defined by using the class keyword. When you create classes, you must consider the following naming conventions and rules.
    • Should be meaningful (strongly recommended).
    • Should ideally be a noun.
    • Can use either the Pascal case or Camel case.




    NOTE: THIS TUT IS KINDA CONTINUED IN MY NEXT TUT. Click here to view my next tut.
    iFlames Reviewed by iFlames on . C# Basics I - Classes in C# Classes in C# Consider the following code example, which defines a class: public class Hello { public static void Main(string args) { System.Console.WriteLine("Hello, World! \n"); } Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Now when did you learn these?

    Well looks good teach me too please.
    I am the TharkiBaba >_> Oh well thats my websites name -_-

  4.     
    #3
    Member
    i just started learning C# eso
    i dont think you can afford my fee

    ---

    oh btw thread updated and will keep on updating

  5.     
    #4
    Member
    Please teach me or else die

    Aah I know you will help me further champ.

    Well good luck learning C# its very easy
    I am the TharkiBaba >_> Oh well thats my websites name -_-

  6.     
    #5
    Retired NinJa
    Website's:
    loledhard.com
    Nice Start Good work in good Direction. Best of Luck



    You don't hate Justin bieber.You hate the fact you ain't Justin Bieber!

  7.     
    #6
    Member
    Nice start
    I am too gonna start soon with it
    Hope to see more tuts from you & others for easy learning step by step

  8.     
    #7
    Member
    I am currently learning C++ in school

  9.     
    #8
    Banned
    classes in C++ is easy... C# everythng goes way above my head..sad..

  10.     
    #9
    Respected Developer
    Are you gonna hate on C# for no reason in every post sniper? Tell me, what about C++ classes do you think is easier?

  11.     
    #10
    Member
    Website's:
    FlowForums.com
    C# is very easy to me anyways. How is it way above your head?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. C++ Basics [Lesson 1]
    By NucleA in forum Web Development Area
    Replies: 7
    Last Post: 3rd Jan 2011, 07:15 AM
  2. What is the point of the php extends in relation to classes?
    By timtamboy63 in forum Web Development Area
    Replies: 11
    Last Post: 16th Oct 2010, 07:59 AM
  3. Protect your Server. The Basics! (cPanel)
    By Storming in forum Technical and Security Tutorials
    Replies: 1
    Last Post: 16th Aug 2009, 07:36 PM
  4. PHP Tutorial (Creating Classes)
    By litewarez in forum Tutorials and Guides
    Replies: 0
    Last Post: 14th May 2009, 11:40 AM
  5. PHP Tutorial (Loopy Loops) Basics
    By litewarez in forum Tutorials and Guides
    Replies: 0
    Last Post: 12th May 2009, 12:53 PM

Tags for this Thread

BE SOCIAL