Java/J2EE and SOA (326 Blogs) Become a Certified Professional

Introduction to Errors in Java

Last updated on Oct 08,2020 2.5K Views

Errors in Java

Java Logo - EdurekaDesign Time Error– These are the errors that occur while designing the programs, for example, syntax errors.

These errors will be shown with a red mark in eclipse IDE so that one can easily find and correct them.

Let us look at an example program:

Package com.edureka.error.designerror;

Public class DesignError{

Public Static void Main (String[] args) {

System.out.printIn(“This is Design-time error”);

;

}

}

Here, in the main method, if the m in Main is capital, it will give an error and if the s of the static keyword is capital, it will do the same.

Also, a semi-colon is placed in the print statement in the end as well as below it.

Logical Errors – These are the errors done by programmers. The programs with these errors run but do not produce the desired results. A common example would be getting division of two numbers as output but expected is multiplication of numbers.

Here, if the syntax is correct, but logic is wrong, then its a logical error which will in turn give wrong results. This typically happens in complex programs where the user is unaware of the logic.

Example:

A program has instructions to print numbers 1 to 5 but prints 6.

Got a question for us? Mention them in the comments section and we will get back to you. 

Related Posts:

Hadoop & Big Data for Java Professionals

JAVA/J2EE & SOA course

Comments
0 Comments

Join the discussion

Browse Categories

webinar REGISTER FOR FREE WEBINAR
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP

Subscribe to our Newsletter, and get personalized recommendations.