Itec30 Flashcards

(53 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

TO STRING()

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. This is known as .

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. This is known as .

A

THROWING 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

The directory separator for Windows is a .

A

BACKSLASH

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

It is the Java directory separator.

A

FORWARDSLASH

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

T OR F

Every class in Java is descended from the java.lang.Object class.

A

TRUE

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

T OR F

The Object class is the parent class of all the classes in java by default.

23
Q

T OR F

Polymorphism occurs when a program invokes a method through a superclass variable.

24
Q

T OR F

Explicit casting must be used when casting an object from a superclass to a subclass.

25
T OR F The Math class is a final class
TRUE
26
T OR F 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.
TRUE
27
T OR F 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.
TRUE
28
T OR F Like an instance method, a static method can be inherited. However, a static method cannot be overridden.
TRUE
29
T OR F If a static method defined in the superclass is redefined in a subclass, the method defined in the superclass
TRUE
30
T OR F Java do not require that the statement that uses the keyword super appear first in the constructor.
FALSE
31
T OR F Runtime errors occur while a program is running if the JVM detects an operation that is impossible to carry out.
TRUE
32
T OR F If the exception is handled, the program will terminate abnormally.
FALSE
33
T OR F The exception is an object created from an exception class.
TRUE
34
T OR F The constructor ArithmethicException(int) is invoked to construct an exception object, where int is a message that describes the exception.
FALSE
35
T OR F The try block contains the code that is executed in normal circumstances.
TRUE
36
T OR F The exception is caught by the fetch block to handle the exception.
FALSE
37
T OR F The root class for exceptions is java.lang.Throwable.
TRUE
38
T OR F You can create your own exception classes by extending Exception or a subclass of Exception.
FALSE
39
T OR F Exception describes errors caused by your program and external circumstances.
TRUE
40
T OR F All other exceptions are known as error exceptions.
FALSE
41
A Subclass inherits from a superclass. You can also: 1. 2. 3.
1. Add new properties 2. Add new methods 3. Override the methods of the superclass
42
Modifier on members in a class 1. 2. 3. 4.
1. Public 2. Default 3. Protected 4. Private
43
Final modifier characteristics 1. 2. 3.
1. The final class cannot be extended 2. The final variable is a constant 3. The final method cannot be overridden by its subclass
44
Runtime Exception, Error and their subclasses are known as_____________
Unchecked Exceptions.
45
___________ are checked at compile time.
Checked Exceptions
46
An assertion contains a __________ that should be true during program execution.
Boolean Exceptions
47
Since _______ is a new Java keyword introduced in JDK 1.4, you have to compile the program using a JDK 1.4 compiler.
ASSERT
48
The filename is a _________.
STRING
49
An ______________ contains a file name with its path and drive letter.
ABSOLUTE FILE NAME
50
In order to perform I/O, you need to create objects using appropriate _______________-.
Java I/O Classes.
51
On the ___________, the absolute file name maybe /home/liang/book/Welcome.java.
UNIX Platform
52
The File class is a ____________ for the file name and its directory path.
Wrapper Class
53
_________- are thrown by JVM and represented in the Error class.
System Errors