Forums Register Login

interface

+Pie Number of slices to send: Send
can a method in an interface be declared static??? why???
+Pie Number of slices to send: Send
They can be but they implicitly static
+Pie Number of slices to send: Send
Methods in the Interface are abstract implicitly and they have to be implemented in some class which will be accesed by objects
(instances)
By making the methods static we mean that it belongs to a class and not any instances and so I think that both abstract and static cant be used together as it will defy the purpose of the interfaces(to be implemented by classes)

Thank you
Steven
+Pie Number of slices to send: Send
i made a mistake interface mmethods cannot be static becaue object must implement them.
If you open the box, you will find Heisenberg strangling Shrodenger's cat. And waving this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 778 times.
Similar Threads
Writing an Interface
Time Capsule
what results byte code in java
How To Call Two Different Classes From the Main Program Using the Same API?
Home interface or Home Interface stub
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 05:08:57.