Class_9_ICSE_Input_in_Java
Class_9_ICSE_Input_in_Java
Comments in Java
Comments are used to make the code more readable and understandable. Java provides three
types of comments:
1. Single-Line Comments
2. Multi-Line Comments
- Syntax:
/*
*/
3. Documentation Comments
- Syntax:
/**
*/
Scanner Class
The Scanner class is used to take input from the user during program execution.
- Import Statement:
import java.util.Scanner;
- Example:
import java.util.Scanner;
Types of Errors
Errors are issues in the program that prevent it from running correctly. The three main types of
1. Syntax Errors
2. Logical Errors
- Description: The program runs but produces incorrect results due to incorrect logic.