1/13
Covers the generals of Java classes and their structural components, terms and core concepts as an OOP language.
Can a java file have more than one class?
Yes
Can a java file have more than one public class?
No
Must a java file have a public class(es)?
No
What does it mean for a class to be public?
It is accessible/visible to classes outside of the stored package/directory.
If a class is not specified to be public, what is it?
It has package-private access, meaning it is only accessible to java files within the same package.
How many non-public classes can a java file have?
A java file can have any number of non-public classes.
What are the two types of class interaction techniques and the names of their components?
Inheritance - comprised of a parent and child class(es).
Use of interface - comprised of an interface and concrete class(es).
Both inheritance and the use of an interface form what core principle of Java as an OOP language?
Polymorphism
When a class is defined as the child class of a parent, what action is the child class performing in relation to the parent class?
The child class is “extending” the parent class.
What does it mean for a child class to inherit from a parent and what is their relationship during object creation?
The child class carries both the methods and data fields of the parent class.
When an object of the child class is created it is an instance of both the child and parent class, but when an object of the parent class is created it is only an instance of the parent class.
What are the fields within an interface?
All of the fields within an interface are abstract method declarations.
What does it mean for a method to be abstract?
fcghcfgndtr
What is the action that a concrete class performs in relation to the interface it uses?
The concrete class is said to “implement” the interface.
What does it mean for a concrete class to implement an interface?
The concrete class must contain definitions of methods that match every abstract method declaration within the interface. There cannot be a declaration in the interface that is not defined in the concrete class, lest the compiler raise an error.