Introduction
Code structure in Java
class {
method {
statement1;
statement2;
statement3;
...
}
}
method {}statement1;}
statement2;
statement3;
...
- Source file: holds one class definition. The file name must be the same as the class name.
- Class: represents a piece of a program.It has one or more methods.
- Method: holds instructions to perform a task. It is a set of statements.