Java Misc Flashcards
What is SAM?
Single Abstract Method
A functional interface facilitating use of lambdas
What does Java do with a class that has no constructor declared?
The compiler automatically provides a public, no-argument constructor called the default constructor
For a class to represent a POJO it must not (3)…
Extend a prespecified class Implement a prespecified interface Contain prespecified annotations
Essentially, a POJO defines an entity
What is a Java Bean?
A POJO with some special restrictions, such as:
Must be Serializable
Fields are private - accessed by getters and setters only
What is the effect of the Serializable annotation?
Converts the state of an object into a bytestream - useful for I/O
What does the static keyword signify?
It is applied to members which belong to a type rather than an instance of the type