TAW_12 Chapter 4, Interfaces and casting Flashcards

1
Q

What section do all interface components belong too

A

Public

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

True or false, interfaces closely resemble super classes

A

True

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

What do interfaces primarily serve to define?

A

Uniform interface protocols

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

In UML, how are interfaces noted?

A

<> and a dotted line

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

How are interface components addressed?

A

~
Full access would be
->~

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

Aliases can be defined for a complete ineterface?

A

No, only by component?

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

Because interfaces must be implemented in the public section, all aliases must also be implemented at the public level?

A

No, you can define an alias in protected or private

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

How can an alias be defined?

A

ALIASES new_name

FOR ~

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

Class A uses interface B. Can I upcast an object of type A to a ref variable of class B?

A

Yes, that’s the whole point. At that you no longer need to use the instance syntax of ~

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

Describe using n interface reference?

A

DATA: lo_part type ref to if_part
Loop at some_table into lo_part. “populates the ref
lo_part->display_name( ). “lo_part is just a template

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

What is the main strength of interafces?

A

Poymorphism

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

What are the two downcast operators?

A

TARGET ?= SOURCE
or
MOVE SOURCE ?TO TARGET

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

To prevent casting errors, what catch should be used in the try block?

A

cx_sy_move_cast_error

RTTI Class services can also be used

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

What happens if I extend a interface with a new method?

A

All classes using the interface must implement the new method

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

Can an interface include other interfaces?

A

Yes

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