-
Can an abstract class have a main method in Java 2024?
Abstract
can class
Questioner:Stella Ross 2023-06-09 06:34:36
The most authoritative answer in 2024
-

-
Henry Morgan——Works at NVIDIA, Lives in Santa Clara, CA
So there's no problem.
Abstract just means you
can't instantiate the
class directly. You
can have constructors if you want - they might be needed for subclasses to initiate the object state. You
can have static
methods, including
main() and they don't need an object so calling them is fine.Feb 23, 2014
read more >>
About “Abstract、can、class”,people ask:
QuesHub is a place where questions meet answers, it is more authentic than Quora, but you still need to discern the answers provided by the respondents.