Return to site
JAVA CERTIFICATION QUESTION: The allowable subtypes in sealed classes
JAVA CERTIFICATION QUESTION: The allowable subtypes in sealed classes
=>You should know what the rules say about subclasses being public, protected, and final.
·
Given the sealed Bird class
public sealed class Bird permits Sparrow {}
Which Sparrow class definitions, when used independently, are valid? Choose two.
A. non-sealed class Sparrow extends Bird { }
B. public class Sparrow extends Bird { }
C. protected class Sparrow extends Bird { }
D. final class Sparrow extends Bird { }
#java #certificationquestion #ocp
·ꓷ puɐ Ɐ suoᴉʇdo ǝɹɐ sɹǝʍsuɐ ʇɔǝɹɹoɔ ǝɥꓕ ·uoᴉsnʅɔuoꓛ