stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Fontys Venlo - Programming Concepts - week 12 Flashcards | StudBud
Explore
/
Fontys Venlo - Programming Concepts - week 12
Fontys Venlo - Programming Concepts - week 12
10 terms
·
StudBud Administration
·
42 plays
#fontys #fhtenl #prc1 #java #week12
Flashcards
10 cards
F
Practice quiz
P
Host live
L
Questions
10
Answers
1
Which statement about
interfaces
is
RIGHT
?
They can be instantiated.
They can have default method implementations.
They cannot extend other interfaces
They can have field variables.
2
Which statement about
abstract classes
is
RIGHT
They can be instantiated.
They cannot extend other abstract classes.
Cannot be used to define common behaviour.
They can have field variables.
3
Have a look at the following code (picture),
why
is the code
not correct
?
Private fields variables are not allowed
getLastname() method must be abstract.
Methods must have an implementation.
getFirstname() method mustnot be abstract
4
Regarding data and method visibility which statement about class/method
modifier
is
incorrect
?
private: Accessable from the same class
public: Accessable from a different package
protected: Accessable from subclass from different package.
default: Accessable from the same package
5
Which of the following can you
instantiate
with
new
?
Interfaces
All answers are correct
Abstract class
Concrete classes
6
Have a look at the following code (picture),
why
is the code
not correct
?
Abstract methods are not allowed in non-abstract-classes.
Fields and abstract methods must be used in interfaces.
Abstract methods are only allowed in interfaces.
Field "name" is not allowed when you have abstract methods.
7
Regarding
overloading and overriding
which statement is
correct
?
Overriding: Methods with same name but different signatures
Overriding: extend a subclass from a superclass
Overloading: new implementation for method in subclass
Overloading: Methods with same name but different signatures
8
How to correctly define an
ArrayList
of Lions?
Lion<> lions = new Lion<ArrayList>();
Lion<ArrayList> lions = new Lion<ArrayList>();
ArrayList<Lion> lions = new ArrayList<Lion>();
ArrayList<> lions = new ArrayList<>();
9
What is
NOT
a characteristic of
inheritance
?
Allows defining new classes from existing classes.
IS an HAS-A relationship
Avoids redundancy
Is an IS-A relationship
10
Which description is correct? (
see picture
)
4
2
1
3