General Knowledge Flashcards
What does @author mean?
Use to specify an author
What does @version mean?
Used to specify a version number
What does @param mean?
Used to describe a parameter
What does @return mean?
Used to describe the value or object returned by the method
What does @see mean?
Use to refer reader to relevant websites or class memebers
True or False?
Wrapper classes are immutable.
True
Automatic type conversion consists of what 2 things?
- 2 data types are compatible
- The value of the SMALLER tyoe is assigned to a BIGGER data type
An attempt to store anything other than a String in a generic type already specified will throw what type of error?
Compile-time error
True or false you can only parametrize reference types NOT primitive types.
True
If an attribute can have a naming conflict with a local variable, how do we differentiate the two.
Use the this keyword
When should one use final?
Use final on any attribute which you want to be a constant
True or False.
Will you get a compile time error if you initialize a final variable outside the constructor
True
What happens if in the constructor we do not use the key word this?
If we do not use this it refers to the parameter, not the instance
If there is a run-time error than it is most likely caused by…
An exception
What is the difference between the == and equals() method?
== means if the variable is true on both sides of the operator for primitive types (int, char)
equals() means to check for the content or value of the actual objects