Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

great tutorials cleatly explains the concept without deviating from the topic. Awaiting for your future posts on functional interfaces and lambda expressions.
- Dilip Kumar Pandey
We can use static interface methods to remove utility classes such as Collections and move all of it’s static methods to the corresponding interface, that would be easy to find and use.
I like the new static interface methods feature, but I don’t think what you suggested here is a good idea - an interface is meant to be implemented, to expand the protocol of an object, whereas utility classes such as Collections are just containers for utility functions, which is a bit of a hack, as Java does not provide support for standalone functions. I think classes are a better choice. Given the newfound power of interfaces, we should leave them for what they are meant for, to define partial protocols (and implementations) for objects in an object-oriented program, and continue to use classes as a pattern for holding non-OO functionality. is that better than using classes?
- Rafael Chaves
With interface default methods there may also be a scenario where an interface is extending another interface and both of those interfaces have same default method.
- Anshudeep
Very good explanation indeed ! ! One very minor observation : In the class Interface1, line 9 -> is the print(str) a typo ? Thanks !
- DRC
Could you please explain how this got printed if we remove static from the interface method MyData Print::
- Tejasvi
Excellent explanation and useful replies. Thanks Pankaj for your blog entries! I suggest we replace line 8 of the MyDataImpl class to the shorter version shown below. It is more concise and common usage, while providing the same result as the current version. Thanks! return str == null;
- JJ
hi, indeed i would also like to know what is with that print from line 9, Interface1, default method. Thanks in advance. regards
- Paula
Hi Pankaj - Thanks for such a concise and self-explanatory blogpost. Quick question - I am trying to understand why is it that Functional Interfaces can have ONLY one method ? Why not overloaded methods ? For example - operate(int a, int b) operate(float a, float b)
- IRS