S
Stefan Ram
»out« is a field of the class »java.lang.System«,
»println« is a method of the object »java.lang.System.out«.
Both classes and objects each can have fields and methods.
Fields and methods of a class are called »static«,
fields and methods of an object are called »non-static« (or so).
Is there a supernotion for both classes and objects that
means something like
»an entity that can have fields and methods«,
so that classes and objects are subnotions of this supernotion?
??
/\
^ / \ ^
is-a/ \is-a
/ \
/ \
class object
(In a sense a class is an object, but is more like a singleton
with static lifetime. However, a class is not an object in the
strict JLS sense of the word object, so I can't use »object«
for this notion.)
»println« is a method of the object »java.lang.System.out«.
Both classes and objects each can have fields and methods.
Fields and methods of a class are called »static«,
fields and methods of an object are called »non-static« (or so).
Is there a supernotion for both classes and objects that
means something like
»an entity that can have fields and methods«,
so that classes and objects are subnotions of this supernotion?
??
/\
^ / \ ^
is-a/ \is-a
/ \
/ \
class object
(In a sense a class is an object, but is more like a singleton
with static lifetime. However, a class is not an object in the
strict JLS sense of the word object, so I can't use »object«
for this notion.)