Back
Close

Beginner Java Concepts

a-Rye
23.8K views

Debugging

There are many things that can go wrong when programming. In Computer Science, we call these "bugs." The most basic categories of bugs are Syntax and Logic bugs. In Java, indentation (or any whitespace really) won't affect if your code compiles or not. However, it is good practice to organize your code with proper spacing.

Syntax is where you have a typo in your code. This could be forgetting a semi colon (;), curly bracket ({}), or any other symbol required for the code to be compiled.

You could be missing a curly bracket:

public static void main(String[] args) 

    System.out.println("Hello World!");

}

Or missing a semi colon:

public static void main(String[] args) {

    System.out.println("Hello World!")

}

Or misspelling a keyword:

pablic statoc vid main(String[] args) {

    System.out.println("Hello World!");

}

Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io