1 Attributes Methods Declared Order Invoked Declaration Declared Void Members Class 2 Invo Q37141133

1. Attributes and methods…

  1. can be declared in any order and invoked before theirdeclaration.
  2. can be declared to be void.
  3. have to be members of a class.

2. An invocation of a mutator method…

  1. changes the type of an attribute of aclass.
  2. updates the value of a local variable in another methodof the same class.
  3. 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 …

  1. open file test.txt for sequential read operations fromits beginning.
  2. open file test.txt for read operations and erase itsprevious content.
  3. create an object
    OR
    OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.