Create templates to quickly answer FAQs or store snippets for re-use.
I want to add that an interface can have a method with a body using the default modifier and it is frequently called @FunctionalInterface.
Please correct answer for question 10 as java 8 allows default methods in interfaces
20 "it should be followed by either a catchblock or a finally block" - not needed when doing try-with-resources, where the finally block is implied.
3 could it be that the title is wrong? Maybe you meant "Can we execute code before the main() method?"
Thank you, updated!
maybe add codes in the markdown code element
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.