"All direct subclasses of the sealed class must be listed in the permits clause except when they
are defined in the same source file. If all the subtypes are coded in the same source file, the
compiler infers the permits clause on it own and saves the developer from typing a few keystrokes
without affecting readability of the code much."
here same source file but i have error on the last line:
Code: Select all
sealed public class Abs permits Con {}
non-sealed class Con extends Abs{}
non-sealed class Con2 extends Abs{}