Beginner Java Concepts

a-Rye
27.7K views

Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

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!");

}

Open Source Your Knowledge: become a Contributor and help others learn. Create New Content