1. Attributes and methods…
- can be declared in any order and invoked before theirdeclaration.
- can be declared to be void.
- have to be members of a class.
2. An invocation of a mutator method…
- changes the type of an attribute of aclass.
- updates the value of a local variable in another methodof the same class.
- updates the value of an attribute of aclass.
3. The following code fragment:
Scanner s = null;
try {
s = new Scanner(newFileInputStream(“test.txt”));
}
catch (FileNotFoundException e) {
System.exit(0);
}
performs one of the following actions …
- open file test.txt for sequential read operations fromits beginning.
- open file test.txt for read operations and erase itsprevious content.
- create an object
OROR