dummies logo
Articles

Article Categories

close
TechnologyAcademics & The ArtsHome, Auto, & HobbiesBody, Mind, & SpiritBusiness, Careers, & Money
Collections

Collections

Explore all collections
close
BYOB (Be Your Own Boss)Be a Rad DadCareer ShiftingContemplating the CosmosFor Those Seeking Peace of MindFor the Aspiring AficionadoFor the Budding Cannabis EnthusiastFor the College BoundFor the Exam-Season CrammerFor the Game Day Prepper
Custom Solutions
Dummies AI
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
forward arrow
  • Custom Solutions
  • Dummies AI
    • Log In
    Explore Book
    Ridding the editor of jagged underlines is cause for celebration. Eclipse likes the look of your Java code, so from that point on, it's smooth sailing. Right?

    Well, it ain't necessarily so. In addition to some conspicuous compile-time errors, your code can have other, less obvious errors.

    Imagine someone telling you to “go to the intersection, and then rurn tight.” You notice immediately that the speaker made a mistake, and you respond with a polite “Huh?” The nonsensical rurn tight phrase is like a compile-time error. Your “Huh?” is like the jagged underlines in Eclipse's editor. As a listening human being, you may be able to guess what rurn tight means, but Eclipse's editor never dares to fix your code's mistakes.

    In addition to compile-time errors, some other kinds of gremlins can hide inside a Java program:

    • Unchecked runtime exceptions: You have no compile-time errors, but when you run your program, the run ends prematurely. Somewhere in the middle of the run, your instructions tell Java to do something that can't be done.

    This is an example of an unchecked runtime exception — the equivalent of someone telling you to turn right at the intersection when the only thing to the right is a big brick wall. Eclipse's editor doesn't warn you about an unchecked runtime exception because, until you run the program, the computer can't predict that the exception will occur.

    • Logic errors: You see no error markers in Eclipse's editor, and when you run your code, the program runs to completion. But the answer isn't correct. Let’s say that instead of $552.20, the output is $552,200,000.00. The program wrongly tells you to pay thousands of times what your house is worth and tells you to pay this amount each month! It's the equivalent of being told to turn right instead of turning left. You can drive in the wrong direction for a very long time.

    Logic errors are the most challenging errors to find and to fix. And worst of all, logic errors often go unnoticed. In March 1985, a homeowner got a monthly home heating bill for $1,328,932.21. Clearly, some computer had printed the incorrect amount. When he called the gas company to complain about it, the telephone service representative said, “Don't be upset. Pay only half that amount.”

    • Compile-time warnings: A warning isn't as severe as an error message. So, when Eclipse notices something suspicious in your program, the editor displays a jagged yellow underline, a tiny yellow icon containing an exclamation point, and a few other not-so-intrusive clues.

    Imagine being told to “turn when you reach the intersection.” The direction may be just fine. But if you're suspicious, you ask, “Which way should I turn? Left or right?”

    When you're sure that you know what you're doing, you can ignore warnings and worry about them at some later time. But a warning can be an indicator that something more serious is wrong with your code. Sweeping recommendation: Pay attention to warnings. But, if you can't figure out why you're getting a particular warning, don't let the warning prevent you from moving forward.

    About This Article

    This article is from the book: 

    Beginning Programming with Java For Dummies

    About the book author:

    Dr. Barry Burd holds an M.S. in Computer Science from Rutgers University and a Ph.D. in Mathematics from the University of Illinois. Barry is also the author of Beginning Programming with Java For Dummies, Java for Android For Dummies, and Flutter For Dummies.

    This article can be found in the category: 

    Java
    Trending
    Moving Abroad For Dummies Cheat Sheet
    Fantastic Four For Dummies Cheat Sheet
    How a New Pope Is Elected in the Conclave
    Format Numbers in Thousands and Millions in Excel Reports
    Football For Dummies (USA Edition) Cheat Sheet
    From Category
    Java
    Important Features of the Java Language
    How to Download and Install TextPad
    How to Install JavaFX and Scene Builder
    Getting a Value from a Method in Java
    A Few Things about Java GUIs

    Quick Links

    About For Dummies
     Terms of Use
    Copyright © 2000-2025 by John Wiley & Sons, Inc., or related companies. All rights reserved, including rights for text and data mining and training of artificial technologies or similar technologies.
    © 2025 MARVEL

    Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

    Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant