Term
How is an interface created? |
|
Definition
Through the methods they expose. |
|
|
Term
|
Definition
Classes derived from other classes (inheriting fields and methods) |
|
|
Term
Abstract classes are what? |
|
Definition
A method that is declared w/out implementation (no braces, following a semicolon) |
|
|
Term
Interface Comparable imposes what? |
|
Definition
Natural ordering of the objects of each class that implements it. |
|
|
Term
TF, The finally block will not execute if the application terminates immediately by calling method System.exit |
|
Definition
|
|
Term
What stream is most appropriate to display errors? |
|
Definition
|
|
Term
TF if a program has a runtime error, it will not compile and run |
|
Definition
|
|
Term
Which package is the Exception class in? |
|
Definition
|
|
Term
A logical error is caused by what? |
|
Definition
The programmer making a mistake thus the program doesn't run as intended (but still runs) |
|
|
Term
What happens if the catch-or-declare requirement for a checked exception is not satisfied? |
|
Definition
The compiler will issue an error message indicating that the exception must be caught or declared. |
|
|
Term
Attempting to access an object through a reference variable before an object is assigned to it will result in which exception? |
|
Definition
|
|
Term
TF, the finally block of a try-catch is mandatory, otherwise the program won't compile |
|
Definition
|
|
Term
TF, int is an example of java class and integer is an example of a java primative |
|
Definition
|
|
Term
The operand of throw can be object of RuntimeException clas |
|
Definition
|
|
Term
Will the print line statement execute here?
while(true?true:false) {
System.out.println("hello");
break;
} |
|
Definition
|
|
Term
The following code legal.
|
|
Definition
|
|
Term
Compiler enforces a catch-or-declare requiremnt for what kind of exception (unchecked, runtime checked) |
|
Definition
|
|
Term
What is the name of the class that describes internal system errors? |
|
Definition
|
|
Term
TF, "Object" class is superclass of "Throwable" class |
|
Definition
|
|
Term
The types of errors described by Exception class can NOT be caught and handled by your program. TF? |
|
Definition
|
|
Term
TF, throws clause does not specify the excpetions a method throws |
|
Definition
|
|
Term
Is IOException a checked exception? |
|
Definition
|
|
Term
TF, an exception is an event, which occurs during the execution of a progra, that dirupts the normla flow of the program's instructions |
|
Definition
|
|
Term
In the catch block below, what is arithmeticException?
catch ( ArithmeticException arithmeticException ) {
System.err.printf( arithmeticException );
} // end catch |
|
Definition
The name of the catch block's exception paramter. |
|
|
Term
TF, IndexOutOfBoundsException is thrown if you access an element in an aray outside the bounds of the array. |
|
Definition
|
|
Term
All exception classes inherit, either directy or indirectly from: |
|
Definition
|
|
Term
The comiler does not check the code to determine whether an checked exception is caught or declared...TF? |
|
Definition
|
|
Term
The process in which a primative is converted to an object is called what? |
|
Definition
|
|
Term
Collections cannot use primitives directly |
|
Definition
|
|
Term
TF, Autoboxing happens automatically in all version of Java 5 and up |
|
Definition
|
|
Term
TF, when implement an interface, having the metohods of methods fo that interface is completely optional |
|
Definition
|
|
Term
When creating the methods in an interface, only what method must be made, and can it contain any actual functionality (code inside)? |
|
Definition
the declaration method must be made and no it cannot |
|
|
Term
What keyword is appropriate for creating an interface? |
|
Definition
|
|
Term
An interface defines a(n) __________ relationship |
|
Definition
|
|
Term
TF, an interface can be treated as a type |
|
Definition
|
|
Term
What is the proper way to get the size of an array? |
|
Definition
|
|
Term
TF, Interfaces are used to encode similarities which the classes of various types share, but do not necessarily constitute a class relationship. |
|
Definition
|
|
Term
implicitly, all interfaces are what? (public, protected, private) |
|
Definition
|
|
Term
When does dynamic binding occur in java? |
|
Definition
|
|
Term
Which of the following would be the wrapper class of this Iterator for loop?
for ( E bar : set ) {
} |
|
Definition
|
|
Term
TF, the Comparable interface requires that the compareTo method be implemented. |
|
Definition
|
|
Term
To get the size of an ArrayList, the length() method will be used...TF? |
|
Definition
|
|
Term
Each object of a class shares static variable, TF? |
|
Definition
|
|
Term
Interfaces cannot specify implementaions for methods, but they can for their... |
|
Definition
|
|
Term
A class can extend only one class, but it can impliment many what? |
|
Definition
|
|
Term
Can an interface contains constructors? |
|
Definition
|
|
Term
What is the output of the following program (If you don't understand, try to run it)?
public class Test {
public static void main(String[] args) {
Boolean b1 = new Boolean(true); Boolean b2 = new Boolean(true); System.out.print(b1 == b2); }
} |
|
Definition
|
|
Term
What is the output of the following program (If you don't understand, try to run it)?
public class Test {
static voaid pass(int i){ System.out.println("I am an int"); } static void pass(Integer i){ System.out.println("I am an Integer"); } public static void main(String[] args) {
pass(1); } } |
|
Definition
|
|
Term
What is the output of the following program (If you don't understand, try it)?
import java.util.ArrayList; import java.util.TreeSet; public class Test{ public static void main(String... args) { ArrayList<Integer> MyList = new ArrayList<Integer>(); MyList.add(21); MyList.add(3); MyList.add(2); MyList.add(3); MyList.add(21); MyList.add(2); MyList.add(20); TreeSet<Integer> tree = new TreeSet<Integer>(MyList); System.out.println(tree.size()); } } |
|
Definition
|
|
Term
STATIC polymorphics in Java is acheved through what |
|
Definition
|
|
Term
Polymorphism is WHAT!? kind of relationship? |
|
Definition
|
|