Results 1 to 5 of 5

Thread: What are the types of errors in C#?

  1. #1
    Join Date
    Sep 2010
    Posts
    35

    What are the types of errors in C#?

    Hello guys, I have recently stated learning C# which is popularly known as C-sharp. I am not able understand errors in C#. I try to understand but get confused between the terms involved in errors. I tried twice but then I decided to give as it was not getting in mind. Can anyone please let me understand what errors are in C # and what are the types in C#?

  2. #2
    Join Date
    May 2009
    Posts
    527

    Re: What are the types of errors in C#?

    I don’t understand what made you not understand the simplest term in C#. Errors are mistakes that can make a program go wrong. An error may produce an incorrect output or may terminate the execution of the program abruptly pr even may cause the system to crash. Usually error occurs when you have missed some important thing. I think that this is the simplest topic in C# which you could study. There are two types of error such as Run time error and compile time error.

  3. #3
    Join Date
    Apr 2009
    Posts
    488

    Re: What are the types of errors in C#?

    There are some errors which occur when while execution of program in C sharp. There are some common error while compile time. All syntax errors will be detected and displayed by the C# compiler and therefore these errors are known as compile-time errors. Whenever the compiler displays an error, it will not create the .cs file. The most common problems are: - Missing semicolons - Missing or mismatch of brackets in classes and methods - Misspelling of identifiers and keywords -Missing of double quotes in strings - Use of undeclared variables - Incompatible types in assignments/initialization - Bad references to objects - Use of = in place of == operator

  4. #4
    Join Date
    May 2009
    Posts
    539

    Re: What are the types of errors in C#?

    Like compile time error there is a run time error in C #. A program may compile successfully creating the .exe file but may not run properly. Such programs may produce wrong results due to wrong logic or may terminate due to errors such as stack overflow. Most common run-time errors are: - Dividing an integer by zero - Accessing an element that is out of the bounds of an array - Trying to store a value into an array of an incompatible class or type - Passing a parameter that is not a valid range or value for a method - Attempting to use a negative size for an array. - Using a null object reference as a legitimate object reference to access a method or a variable. - Converting an invalid string to a number or vice versa -Accessing a character that is out of bounds of a string.

  5. #5
    Join Date
    Apr 2009
    Posts
    569

    Re: What are the types of errors in C#?

    You should know that there is a huge difference between error and exception. An exception is a condition that is caused by a run-time error in the program. If the exception object is not caught and handled properly, the compiler will display an error message and will terminate the program. If we want the program to continue with the execution of the remaining code, then we should try to catch the exception object by the error condition and then display an appropriate message for taking corrective actions. This task is known as exception handling.

Similar Threads

  1. Types of CRM
    By Vicky Woodley in forum Education Career and Job Discussions
    Replies: 5
    Last Post: 18-11-2010, 08:39 AM
  2. Different types of RAM
    By Eleeazar in forum Hardware Peripherals
    Replies: 3
    Last Post: 25-11-2009, 02:49 AM
  3. Different types Types CCFL's
    By Zipp in forum Overclocking & Computer Modification
    Replies: 3
    Last Post: 29-10-2009, 09:11 AM
  4. What are the Different types of errors in PHP?
    By Taipai in forum Software Development
    Replies: 3
    Last Post: 12-09-2009, 01:00 PM
  5. Different RAM types and its uses
    By eliotmc in forum Hardware Peripherals
    Replies: 2
    Last Post: 13-10-2008, 01:57 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,710,831,548.04923 seconds with 16 queries