473,797 Members | 3,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

exception(logic error and runtime error)

Hello Experts!

I reading a book called programming with design pattern revealed
by Tomasz Muldner and here I read something that sound strange.

"Exception are divided into logic errors and runtime errors. Logic errors
represent static errors that
can be prevented and detected at compile time. Runtime errors represent
dynamic errors that can be detected only at runtime."

Now to my question what does it mean with "Logic errors represent static
errors that
can be prevented and detected at compile time." The compiler will not detect
if you index out of range
in an array so why does it then say that Logic errors represent static
errors that
can be prevented and detected at compile time. It exist an logic_error class
exception that has name out_of_range.

Many thanks

//Tony
Aug 13 '05 #1
0 1905

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
277
by: Fiona McBride | last post by:
Hi all, I have a really odd problem with some Visual Basic .NET 2003 code; I have a program that creates a number of windows which contain RichTextBox, Timers (disabled) and menus. The code runs fine and creates the windows as required, BUT if the program is left to do nothing for several hours, when it is brought back into focus it generates an exception error (Object reference not set to instance of an object - this always coincides...
4
1281
by: tarmat | last post by:
I have a class that has a std::list of ints as a member. Let's say its this: std::list<int> MyInts; Frequently, another list of ints is assigned to MyInts MyInts = MyOtherInts; This occasionally gives me a "First-chance exception" error. I haven't
1
1234
by: Mech | last post by:
I am trying to connect to a simple Access Database on my c drive. I am using Windows 2000 pro; nothing special. the following code produces a security exception error. Why? string ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;" + "DataSource=c:\\nwind.mdb"; Conn = new OleDbConnection(ConnStr); thanks for your help,
2
2170
by: Yuki | last post by:
I tried to open a binary file use BinaryReader. BinaryReader binReader = new BinaryReader(File.Open(fileName, FileMode.Open, FileAccess.Read, FileShare.Read)); This file is open by another process at the same time. An exception is generated said "This file is being used by another process". What should I do to open this file for read only and an exception error?
6
5782
by: Paul | last post by:
Hello, The following code generates an exception error the *second* time it is called. Can anyone see what I'm doing wrong? There is a similar example in Wrox Professional VB.NET Page 289. Error: An unhandled exception of type 'System.ObjectDisposedException' occurred in mscorlib.dll
9
2103
by: Ron | last post by:
my application is throwing an exception error when closing if I run a procedure in the app. I can't even trap the error with try/catch ex As Exception. Is there a way to completely shut down the app through code? I am using End for now. Is there a way I can suppress this exception message? The app gets invoked programmatically on a schedule. So no one would be around to click off the
8
8471
by: Philip Colmer | last post by:
I'm rewriting some existing VBScript into VB.Net code. It was all going well until I hit the following error when testing the code: System.Runtime.InteropServices.COMException (0x80041003) at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object args, String paramnames, Boolean CopyBack) The specific call that is failing is:
2
2272
by: shivp | last post by:
Hi, I'm getting folowing exception error while compiling the code in VS2005. $exception {Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.} System.Exception {System.Threading.ThreadAbortException} How to overcome this error. Please send the ASAP Thanks in Advance.
2
1998
by: csharp learner | last post by:
Hi, I'm trying to update a datagrid view table to the Oracle DB. This is my code so far.... // Connection to Oracle DB int connectionCounter = 0; bool boolUpdateData = true; while (boolUpdateData && connectionCounter < 3) { try
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10469
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10246
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10209
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10023
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9066
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6803
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5459
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.