Basic Java Language: Difference between revisions

wikademia>Remi0o
wikademia>Remi0o
Line 2: Line 2:


=Touch on Classes=
=Touch on Classes=
Everything, in Java, is done inside classes. Essentially, classes are bodies of statements, methods, and variables. To whet your curiosity, a method usually consists of a sequence of statements to perform an action, a set of input parameters to customize those actions, and possibly an output value (called return value) of some kind. There is a method called main that all classes have. This is the start point of your program - where everything must begin. To create a class, the syntax (or basic outline in code) is:
Everything in Java is done inside classes. Classes are bodies of statements, methods, and variables. A statement can be thought of as the smallest standalone element of an imperative programming language. A program is formed by a sequence of one or more statements. A statement will have internal components (e.g. expressions). A method usually consists of a sequence of statements to perform an action, a set of input parameters to customize those actions, and possibly an output value (called return value) of some kind. There is a method called main that all classes have. This is the start point of your program - where everything must begin. To create a class, the syntax (or basic outline in code) is:
<pre>
<pre>
[Protection] class [Name] [Extend/Implements...]
[Protection] class [Name] [Extend/Implements...]