itec30 Flashcards

(52 cards)

1
Q

It enables you to define superclass and subclasses.

A

inheritance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

This method returns a string representation of the object.

A

toString()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

It is a type that defined by a subclass.

A

subtype

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

It is a type that defined by a superclass

A

Supertype

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

It means that a variable of a supertype can refer to a subtype object.

A

polymorphism

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

It can also be used to convert an object of one class to another within an inheritance hierarchy.

A

casting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

It can be used to test whether an object is an instance of a class.

A

instance of operator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

It is another method that defined in the object class that often used.

A

equal method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

It is a modifier can be applied on a data and methods in a class.

A

protected modifier

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

It is a modifier that indicates that a class is cannot be a parent class

A

final modifier

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

It is an object that represents an error or a condition that prevents execution from proceeding normally.

A

exception

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

It is thrown if you access an object through a reference variable before an object is assigned to it.

A

NullPointerException

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

It is thrown if you access an element in array outside the bounds of array.

A

IndexOutOfBoundsException

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Every method must state the types of checked exceptions it might throw

A

declaring exceptions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

When the program detects an error, the program can create an instance of an appropriate exception type and throw it.

A

throwing exception / throwing an exception

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

It is declared using the new Java keyword assert in JDK 1.4

A

assertion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

It is intended to provide an abstraction that deals with most of machine-dependent complexities of files a path names in a machine independent fashion.

A

file class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

directory separator for windows

A

backslash

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

java directory separator

A

forward slash

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

it is in relation to the current working directory

A

relative file name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Modifier on members in a class

A
  1. Public
  2. Default
  3. Protected
  4. Private
22
Q

Final modifier characteristics

A
  1. The final class cannot be extended
  2. The final variable is a constant
  3. The final method cannot be overridden by its subclass
23
Q

Runtime Exception, Error and their subclasses are known as

A

Unchecked exceptions

24
Q

_______checked at compile
time.

A

checked exceptions

25
An assertion contains a __________ that should be true during program execution
boolean expression
26
____ is a new Java keyword introduced in JDK 1.4, you have to compile the program using a JDK 1.4 compiler.
assert
27
filename is a ____
string
28
______ contains a file name with its path and drive letter.
absolute filename
29
In order to perform I/O, you need to create objects using appropriate
java i/o classes
30
absolute filename maybe home/liang/book/welcome java
UNIX platform
31
the file class is a ____ for the file name and its directory path
wrapper class
32
_____ are thrown by JVM and represented in the error class
system errors
33
Every class in Java is descended from the java.lang.Object class. T or F
true
34
The Object class is the parent class of all the classes in java by default. T or F
true
35
Polymorphism occurs when a program invokes a method through a superclass variable. T or F
true
36
Explicit casting must be used when casting an object from a superclass to a subclass. T or F
true
37
The Math class is a final class. T or F
true
38
A subclass inherits methods from a superclass. Sometimes it is necessary for the subclass to modify the implementation of a method defined in the superclass. This is referred to as method overriding T or F
true
39
To override a method, the method must be defined in the subclass using the same signature and the same return type as in its superclass. T or F
true
40
Like an instance method, a static method can be inherited. However, a static method cannot be overridden. T or F
true
41
If a static method defined in the superclass is redefined in a subclass, the method defined in the superclass. T or F
true
42
Java do not require that the statement that uses the keyword super appear first in the constructor. T or F
false
43
Runtime errors occur while a program is running if the JVM detects an operation that is impossible to carry out. T or F
true
44
If the exception is handled, the program will terminate abnormally. T or F
false
45
The exception is an object created from an exception class. T or F
ttrue
46
The constructor ArithmethicException(int) is invoked to construct an exception object, where int is a message that describes the exception. T or F
false
47
The try block contains the code that is executed in normal circumstances. T or F
true
48
The exception is caught by the fetch block to handle the exception. T or F
false
49
The root class for exceptions is java.lang.Throwable. T or F
true
50
You can create your own exception classes by extending Exception or a subclass of Exception. T or F
false
51
Exception describes errors caused by your program and external circumstances. T or F
true
52
All other exceptions are known as error exceptions. T or F
false