JM 5 Flashcards
What is a Javadoc comment?
A Javadoc comment is set off from code by standard multi-line comment tags /* and */. The opening tag (called begin-comment delimiter), has an extra asterisk, as in /**. The first paragraph is a description of the method documented. Following the description are a varying number of descriptive tags, signifying: The parameters of the method (@param) What the method returns (@return) Any exceptions the method may throw (@throws) Other less-common tags such as @see (a “see also” tag)
Name 3 good uses for comments
- Explaining what a program does
- Explaining obscure lines of code
- Documenting the methods and classes that other programmers will use.
- Disable parts of code e.g “commenting out” lines.
Style vs Syntax?
A program begins with a comment.
Style
Style vs Syntax
Names of all methods begin with a lowercase letter
Style
Style vs Syntax
Each opening brace has a matching closing brace
Syntax
Style vs Syntax
All statements within a pair of matching braces are indented by 2 spances.
Style
Style vs Syntax
A closing brace is place on a separate line.
Style
Style vs Syntax
A class has a lank line before each method declaration.
Style
Style vs Syntax
The word IF is not used as a name for a variable.
Style
What are the Java primitive data types?
- char
- byte
- int
- long
- short
- double
- float
- boolean
- void
- enum
What are the java buil in constants?
- true
- false
- null
What are Java’s built-in storage/access modifiers?
- public
- private
- protected
above are access modifiers
- final
- static
What are Java’s built-in control statements (/keywords are used in control statements) ?
- if
- else
- for
- while
- do
- switch
- case
- default
- break
- return
Which Java keywords deal with classses and inheritance?
- import
- class
- interface
- extends
- implements
- new
- this
- super
- abstract
- instanceof
Which reserved words deal with exception handling?
- try
- catch
- finally
- throw
- throws