-
What api contains the java collections framework?
The Java Utilities API in the package java.util
-
What package contains the FilenameFilter interface, and what does it do?
The FilenameFilter is in the java.io package and it defines the functionality to filter filenames
-
What does the java.io.File class provide a representation of?
It provides a representation of file and directory pathnames
-
What does the java.io.FileDescriptor class provide?
The FileDescriptor class provides a means to function as a handle for opening files and sockets.
-
What does the java.io.RandomAccessFile class allow?
The java.io.RandomAccessFile class allows for the reading and writing of files to specified locations.
-
What package contains the java networking api?
java.net
-
What does the java.net package provide?
The java.net package provides functionality in support of creating network applications
-
What are the key classes and interfaces in the Java Networking API?
- Socket
- ServerSocket
- URL
- Inet4Address
- Inet6Address
-
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
-
What is the package prefix 'java' more commonly used for?
The prefix 'java' is commonly used for the core packages
-
What is the package prefix 'javax' more commonly used for?
The prefix 'javax' is commonly used for packages that comprise Java standard extensions
-
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 GreetingsUniversise.java
-
What does the the -cp or -classpath command-line option do?
Tells the compiler where the desired classes and packages are.
-
What command lets you optionally start the program on Microsoft Windows to exclude the command window.
javaw
-
What does the -D command option do?
- It allows for the setting of new property values.
- java -D<name>=<value> class
-
What is an assignment statement?
An assignment statement sets a value within a variable
-
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)
-
What primitive would you use to store a value that will be a whole number
int
-
What primitive would you use to store a Unicode value?
char
-
What primitive would you use to store a value that may not be a whole number if you are concerned with memory size?
float
-
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.
double
-
What primitive would you use to store a very large whole number?
long
-
What primitive would you use to store a value of 3000, without using any more memory than needed?
short
-
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
-
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.
-
If an array uses a primitive data type, does a new operator need to be used in initialization?
Yes
-
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.
-
What is casting?
Changes data into new data type.
-
What is a literal?
A literal is a value that is not a variable.
-
What are the four access modifiers and which is the default?
- private
- default (package-private)
- protected
- public
- * all lowercase
-
How many variables can a method return?
1 or none
-
What is method overloading?
Overloading methods is when more than one method shares the same name, but has a different parameter list.
-
Where are local variables declared?
Inside methods
-
What variable scope would be best suited for a counter in a loop?
Local Variable
-
What variable scope must be used to store information about the state of an object?
Instance variable
-
What variable scope must be used to pass information to a method?
Method Parameter
-
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
-
When does a class inherit another class?
When it is extended
-
Can you inherit multiple classes into one?
No
-
Can you create objects of an abstract class?
No
-
Can a base class be defined as an abstract class, even if it doesn’t define any abstract methods
Yes
-
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.
|
|