itec30 Flashcards

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
Q

An assertion contains a __________ that should be true during program execution

A

boolean expression

26
Q

____ is a new Java keyword introduced
in JDK 1.4, you have to compile the program
using a JDK 1.4 compiler.

A

assert

27
Q

filename is a ____

A

string

28
Q

______ contains a file name with its path and drive letter.

A

absolute filename

29
Q

In order to perform I/O, you need to create objects using appropriate

A

java i/o classes

30
Q

absolute filename maybe home/liang/book/welcome java

A

UNIX platform

31
Q

the file class is a ____ for the file name and its directory path

A

wrapper class

32
Q

_____ are thrown by JVM and represented in the error class

A

system errors

33
Q

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

A

true

34
Q

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

A

true

35
Q

Polymorphism occurs when a program invokes a method through a superclass variable. T or F

A

true

36
Q

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

A

true

37
Q

The Math class is a final class. T or F

A

true

38
Q

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

A

true

39
Q

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

A

true

40
Q

Like an instance method, a static method can be inherited. However, a static method cannot be overridden. T or F

A

true

41
Q

If a static method defined in the superclass is redefined in a subclass, the method defined in the superclass. T or F

A

true

42
Q

Java do not require that the statement that uses the keyword super appear first in the constructor. T or F

A

false

43
Q

Runtime errors occur while a program is running if the JVM detects an operation that is impossible to carry out. T or F

A

true

44
Q

If the exception is handled, the program will terminate abnormally. T or F

A

false

45
Q

The exception is an object created from an exception class. T or F

A

ttrue

46
Q

The constructor ArithmethicException(int) is invoked to construct an exception object, where int is a message that describes the exception. T or F

A

false

47
Q

The try block contains the code that is executed in normal circumstances. T or F

A

true

48
Q

The exception is caught by the fetch block to handle the exception. T or F

A

false

49
Q

The root class for exceptions is java.lang.Throwable. T or F

A

true

50
Q

You can create your own exception classes by extending Exception or a subclass of Exception. T or F

A

false

51
Q

Exception describes errors caused by your program and external circumstances. T or F

A

true

52
Q

All other exceptions are known as error exceptions. T or F

A

false