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

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.

A

TRUE

23
Q

T OR F

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

A

TRUE

24
Q

T OR F

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

A

TRUE

25
Q

T OR F

The Math class is a final class

A

TRUE

26
Q

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.

A

TRUE

27
Q

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.

A

TRUE

28
Q

T OR F

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

A

TRUE

29
Q

T OR F

If a static method defined in the superclass is redefined in a subclass, the method defined in the superclass

A

TRUE

30
Q

T OR F

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

A

FALSE

31
Q

T OR F

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

A

TRUE

32
Q

T OR F

If the exception is handled, the program will terminate abnormally.

A

FALSE

33
Q

T OR F

The exception is an object created from an exception class.

A

TRUE

34
Q

T OR F

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

A

FALSE

35
Q

T OR F

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

A

TRUE

36
Q

T OR F

The exception is caught by the fetch block to handle the exception.

A

FALSE

37
Q

T OR F

The root class for exceptions is java.lang.Throwable.

A

TRUE

38
Q

T OR F

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

A

FALSE

39
Q

T OR F

Exception describes errors caused by your program and external circumstances.

A

TRUE

40
Q

T OR F

All other exceptions are known as error exceptions.

A

FALSE

41
Q

A Subclass inherits from a superclass. You can also:
1.
2.
3.

A
  1. Add new properties
  2. Add new methods
  3. Override the methods of the superclass
42
Q

Modifier on members in a class
1.
2.
3.
4.

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

Final modifier characteristics
1.
2.
3.

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
44
Q

Runtime Exception, Error and their subclasses are known as_____________

A

Unchecked Exceptions.

45
Q

___________ are checked at compile time.

A

Checked Exceptions

46
Q

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

A

Boolean Exceptions

47
Q

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

A

ASSERT

48
Q

The filename is a _________.

A

STRING

49
Q

An ______________ contains a file name with its path and drive letter.

A

ABSOLUTE FILE NAME

50
Q

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

A

Java I/O Classes.

51
Q

On the ___________, the absolute file name maybe /home/liang/book/Welcome.java.

A

UNIX Platform

52
Q

The File class is a ____________ for the file name and its directory path.

A

Wrapper Class

53
Q

_________- are thrown by JVM and represented in the Error class.

A

System Errors