Yes we can have multiple classes in single file but it people rarely do that and not recommended. We can
have multiple classes in File but only one class can be made public. If we try to make two classes in File
public we get following compilation error.
โThe public type must be defined in its own fileโ
Can we have multiple classes in single file ?
by
Tags:
Leave a Reply