Study for OCA

Card Set Information

Study for OCA
2014-04-22 06:48:21
Personal Study
Show Answers:

  1. What api contains the java collections framework?
    The Java Utilities API in the package java.util
  2. What package contains the FilenameFilter interface, and what does it do?
    The FilenameFilter is in the package and it defines the functionality to filter filenames
  3. What does the class provide a representation of?
    It provides a representation of file and directory pathnames
  4. What does the class provide?
    The FileDescriptor class provides a means to function as a handle for opening files and sockets.
  5. What does the class allow?
    The class allows for the reading and writing of files to specified locations.
  6. What package contains the java networking api?
  7. What does the package provide?
    The package provides functionality in support of creating network applications
  8. What are the key classes and interfaces in the Java Networking API?
    • Socket
    • ServerSocket
    • URL
    • Inet4Address
    • Inet6Address
  9. What API is recommended for creating GUIs?  The Java Abstract Window Toolkit API, java.awt or Java Swing API, javax.swing
    The Java Swing API, javax.swing
  10. What is the package prefix 'java' more commonly used for?
    The prefix 'java' is commonly used for the core packages
  11. What is the package prefix 'javax' more commonly used for?
    The prefix 'javax' is commonly used for packages that comprise Java standard extensions
  12. When compiling from command line, what option would you use if you want to specify explicitly where you would like the compiled bytecode class files to go
    • The -d option.  
    • javac -d classes
  13. What does the  the -cp or -classpath command-line option do?
    Tells the compiler where the desired classes and packages are.
  14. What command lets you optionally start the program on Microsoft Windows to exclude the command window.
  15. What does the -D command option do?
    • It allows for the setting of new property values.
    • java -D<name>=<value> class
  16. What is an assignment statement?
    An assignment statement sets a value within a variable
  17. What are the 8 primitive data types on the exam?
    • boolean (boolean)   
    • char (character)   
    • byte (byte)   
    • short (short integer)   
    • int (integer)   
    • long (long integer)   
    • float (floating point)   
    • double (double precision floating point)
  18. What primitive would you use to store a value that will be a whole number
  19. What primitive would you use to store a Unicode value?
  20. What primitive would you use to store a value that may not be a whole number if you are concerned with memory size?
  21. What primitive would you use to store large or high precision floating-point number? This also tends to be the default primitive for floating-point numbers.
  22. What primitive would you use to store a very large whole number?
  23. What primitive would you use to store a value of 3000, without using any more memory than needed?
  24. What are the wrapper classes?
    Java has a built-in wrapper class for each primitive that can convert a primitive to an object.  The wrapper classes are Integer, Double, Boolean, Character, Short, Byte, Long, and Float
  25. Do primitives and objects need to be initialized with the new operator?
    No, unlike a primitive, an object must be initialized with the new operator. Before initialization, an object is set to null by default. If a null object is used, it will throw a null pointer exception.
  26. If an array uses a primitive data type, does a new operator need to be used in initialization?
  27. When is an enumeration useful?
    An enumeration is useful when there is a limited set of options that a variable can equal and it is restricted to these known values.
  28. What is casting?
    Changes data into new data type.
  29. What is a literal?
    A literal is a value that is not a variable.
  30. What are the four access modifiers and which is the default?
    • private
    • default (package-private)
    • protected
    • public
    • * all lowercase
  31. How many variables can a method return?
    1 or none
  32. What is method overloading?
    Overloading methods is when more than one method shares the same name, but has a different parameter list.
  33. Where are local variables declared?
    Inside methods
  34. What variable scope would be best suited for a counter in a loop?
    Local Variable
  35. What variable scope must be used to store information about the state of an object?
    Instance variable
  36. What variable scope must be used to pass information to a method?
    Method Parameter
  37. What is polymorphism?
    Polymorphism is a technique that allows a specific object, such as a dog object, to be referred to in code as its more general parent animal
  38. When does a class inherit another class?
    When it is extended
  39. Can you inherit multiple classes into one?
  40. Can you create objects of an abstract class?
  41. Can a base class be defined as an abstract class, even if it doesn’t define any abstract methods
  42. What are types of exceptions that you should not catch?
    • The exceptions that are defined by the Error class and its subclasses.  
    • ThreadDeath, 
    • LinkageError,
    • VirtualMachineError.