Types of Common Errors in Java programming Eclipse

preview_player
Показать описание
Three types of errors common in Java Programming.
They are:
Syntax Errors: For example when you forget a ; after a statement or a " in a String.
Runtime Errors: For example when you divide by 0 zero.
Logic Errors: For example when you don't use parenthesis in mathematical calculations and it multiplies first instead of adding.

Eclipse can help detecting Syntax Errors before compiling. After you run your program, if there is a Runtime error, Eclipse will let your know in the console. Logical errors must be detected by the user/developer.
Рекомендации по теме
Комментарии
Автор

For the logic error the reason it does the operation the way it does is because of PEMDAS and addition is after division so it will only add the 2 and 8 if you use parentheses

doctoranonymous
Автор

clear understanding with minimum time, thank you so much

VipinKumar-jebq
Автор

error: <identifier> expected
piblic static void Calculator (String[] args) {
i got this indication and i am trying to figure out what is wrong with my code, which is an instance of scanner
import Java.util.scanner;


public class Main {

piblic static void Calculator (String[] args) {
Scanner num = new Scanner(System.in);
int first, second, result;
System.out.print("Enter first num: ");
first = num.nextInt();
System.out.print("Enter second num: ");
second = num.nextInt();
result = first + second;
System.out.print("result is-" + result);
}


}
thank you in advance for any help!

arturvoznenko
Автор

public class DebuggingProgram
{
public static void main(String[] args)
{
int sum = 3 - 3;
System.out.println("The sum of 3 + 3 = " + sum);
}
}

how to find logical errors in this????
pleaseee

arnoldespanillo
Автор

Is semantics error same as logic error?

jonahreuben
Автор

Thank u so much it helped me a lot 🤍🤍🤍

lalajmy