Hello guys!
Here I continue the basics of the object oriented programming, that I started here , by talking about coments, operators and execution control statements.
A summary of what we've talked about in the previous post:
We are going to talk a little about comments.
We can comment code in two ways: /* some comment */ - the traditional C style comment, begin with a /* and continue, possibly across many lines, until a */
The Second type of comment comes from C++ and it's the single line comment, starts with a // and continues until the end of the line. Example: //This is a comment
Comment documentation:
Javadoc is a tool used for generating Java code documentation in HTML format from Java code and requires documentation in a predefined format.
These comments may be placed above any class, method or fild which we want to ducoment and are commonly made up of two sections:
- The description of what we're commenting on
- The standalone block tags (marked with the "@" symbol) which describe specific meta-data
All javadoc commands occur only within /* */ comments
Some of those commands are:
- @see - provide link to another class that may help provide clarity
- {@docRoot} - the relative path
- @version - current version
- @author - names of the autors
- @since - the version where this piece of code was introduced
- @deprecated
- @param
- @return
- @throws
- Addition (+)
- Subtraction (-)
- Division (/)
- Multiplication (*)
- Modulus (%) - the remainder from integer division
Pre and Post:
- Pre-increment, the ++ operator appears before the variable (++a)
- Post-increment, the ++ operator appears after the variable (a++)
- Pre-decrement, the -- operator appears before the variable (--a)
- Post-decrement, the -- operator appears after the variable (a--)
- less than (<)
- greater than (>)
- less than or equal to (<=)
- greater than or equal to (>=)
- equivalent (==)
- not equivalent (!=)
- if-else operator, ex: bool?a:b - means if bool is true, return a, if bool is false, return b
- String operator "+" - concatenates strings
- Cast is used to make a type conversion explicit
- return , specifies the value returned by a method
- if-else
- while
- do-while
- for
- switch
- break
- continue
0 Comments