Review Questions
- What other tutorials are available from the Sun website?
- What is the skeleton for any Java program?
- What is the entry point for any Java application?
- What is the function of the import statement?
- What are some of the benefits gained by using a coding standard?
- Which of the following are valid variable names in Java?
_object
object-oriented
object_oriented
object.oriented
$java
Java
Integer
String
Int
933
fm90.5
1fm
- What is the order of precedence among arithmetic operators?
- What is the difference in assignment between primitives and objects?
- What is aliasing?
- What are arithmetic operators?
- How do auto pre-increment, pre-decrement, post-increment, and post-decrement work?
- What are the relational operators?
- How does one test for object equivalence?
- What are the logical operators?
- What are the bitwise operators?
- What is the shift operator?
- What is the function of the string + operator?
- How does explicit casting work in Java?
- How are literals used to specify type in Java?
- What are the two basic forms of “if”?
- How does “while” differ from “do-while”?
- What is unique to the “for” statement with regard to defining variables?
- How are “break” and “continue” used in Java?
- How is “break” used within “switch”?
- What is the purpose of a constructor?
- How are overloaded methods distinguished from each other?
- What is a default constructor?
- How is the keyword “this” used in Java?
- What is the purpose of “finalize”?
- Why is “finalize” not as good as a destructor?
- Why must one perform a clean-up?
- What are the initial values of the primitives that are encapsulated in an object, and what are the initial values of the primitives that are not encapsulated in an object?
- What is the advantage of constructor initialization?
- When are variables in an object initialized?
- What are the steps in the process of creating an object?
- What is an explicit static initialization?
- What is a non-static instance initialization?
- What is the advantage of bounds checking?
- What is an array of handles?
- What is encapsulation? How does encapsulation contribute to software maintainability?
- How would you enhance the following code to achieve the desired effect of encapsulation? What is the trade-off of your enhancement? What are its advantages?
class time {
int hour;
int minute;
time() {};
public static void main (String arg[]) {
time t = new time();
t.hour = 3;
t.minute = 25;
System.out.println("The time now is "+t.hour+":"+t.minute);
}
}
- What is the advantage of inheritance in development work?
Updated July 30 2020 by FST Course Production Staff