Review Questions


graphics/rq_icon.gif
4.14

Given the following class, which of these are valid ways of referring to the class from outside of the package net.basemaster ?

 package net.basemaster; public class Base {     // ... } 

Select the two correct answers.

  1. By simply referring to the class as Base .

  2. By simply referring to the class as basemaster.Base .

  3. By simply referring to the class as net.basemaster.Base .

  4. By importing with net.basemaster.* and referring to the class as Base .

  5. By importing with net.* and referring to the class as basemaster.Base .

4.15

Which one of the following class definitions is a valid definition of a class that cannot be instantiated ?

Select the one correct answer.

  1.  class Ghost {        abstract void haunt();    } 
  2.  abstract class Ghost {        void haunt();   } 
  3.  abstract class Ghost {        void haunt() {};    } 
  4.  abstract Ghost {     abstract void haunt();    } 
  5.  static class Ghost {        abstract haunt();    } 
4.16

Which one of the following class definitions is a valid definition of a class that cannot be extended?

Select the one correct answer.

  1. class Link { }

  2. abstract class Link { }

  3. native class Link { }

  4. static class Link { }

  5. final class Link { }

  6. private class Link { }

  7. abstract final class Link { }



A Programmer[ap]s Guide to Java Certification
A Programmer[ap]s Guide to Java Certification
ISBN: 201596148
EAN: N/A
Year: 2003
Pages: 284

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net