Java Misc Flashcards

1
Q

What is SAM?

A

Single Abstract Method

A functional interface facilitating use of lambdas

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

What does Java do with a class that has no constructor declared?

A

The compiler automatically provides a public, no-argument constructor called the default constructor

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

For a class to represent a POJO it must not (3)…

A
Extend a prespecified class
Implement a prespecified interface
Contain prespecified annotations

Essentially, a POJO defines an entity

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

What is a Java Bean?

A

A POJO with some special restrictions, such as:
Must be Serializable
Fields are private - accessed by getters and setters only

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

What is the effect of the Serializable annotation?

A

Converts the state of an object into a bytestream - useful for I/O

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

What does the static keyword signify?

A

It is applied to members which belong to a type rather than an instance of the type

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