I assume you mean a class that isn't public by saying it's default.
Yes you can subclass it. You can even put the default and its subclass in the same file if you like (remember you can have multiple classes in a file but only one top-level class can be public). At the very least the subclass must be in the same package though, because of visibility.
You can even make the subclass public if you like. It wouldn't be likely you'd ever want to do this but you could.
I am one of the moderators of the JavaRanch forums. Here on JavaRanch, we have a naming policy. We want the users of JavaRanch to use a real-sounding name as their display name.
Unfortunately, your name "miria" does not comply to the naming policy. Your display name should consist of a real-sounding first name, space, and a second name. Not only a first name, no obviously fake nickname, no initials only for the second name.
Please read the naming policy carefully and change your display name. You can change your name by editing your profile.
Please note that we are taking the naming policy seriously. If you do not change your display name, your account on JavaRanch might be locked.