What are local interfaces? Describe.
Answer / Priyanka Kashyap
"Local interfaces" are Java interfaces that are declared within a package-private or private scope, meaning they can only be accessed within the same package as their declaring class. Unlike regular interfaces, local interfaces cannot have static members and must be implemented by the same class that declares them. They provide a way to define interface methods without the need for a separate file.nnExample:npublic class MyClass {nprivate interface LocalInterface {nvoid myMethod();n}nnpublic void doSomething() {nnew LocalInterface() {n@Overridenvoid myMethod() {n// implementation heren}n}.myMethod();n}n}
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the difference between static and non-static with examples?
Why use a datasource when you can directly specify a connection details? (in a J2EE application)
What are different types of layout managers in java.awt package?
JMS based on what technology?
Explain the methods of Naming class, rebind( ) and lookup()?
whats is mean by connectionpooling
What is a modular application? What does module-relative mean?
What is RMI architecture?
what we can't do in jdbc but can do hibernate?
What is the use of Semaphore?
Explain the steps in details to load the server object dynamically?
What is clustering? What are the different algorithms used for clustering?