The NetBeans project is located here: interfaces.zip
Monday, April 16, 2012
Public, Protected, and Private Interfaces... Yes Interfaces.
One of the junior developers came to me on Friday and asked if an interface could be private, or protected. I said sure, but it must be an inner interface. The interface must be contained within a containing class. So I decided to create a couple of examples of interface fun for you to appreciate.
The NetBeans project is located here: interfaces.zip
The NetBeans project is located here: interfaces.zip
Subscribe to:
Post Comments
(
Atom
)
Popular Posts
-
Introduction This article is not another diatribe to tell you the importance of unit testing. I think we can all agree that it is important...
-
A friend of mine asked me if there was a list of reserved words in EL and JSF. He had previously looked for it, and after some Google search...
-
I saw a question posed on stackoverflow called Trouble with Primefaces 3.0.M2 SelectOneMenu Ajax behavior and I had just done an example a...
-
I was working on a couple of SSL based issues when I made a couple of observations. The default self-signed key generation in Java does not ...
-
This is an example on how to make a system call to the local operating system to execute external programs. This example was written to work...
-
We have been doing a lot of work lately with PrimeFaces. A common set of questions comes up about displaying <p:dialog/> boxes on a pa...
-
I was asked earlier today how to reset fields in a JSF application, if the validation fails. In his case, he had a Richfaces table which had...
-
Image by quasarkitten via Flickr The basics for creating a Maven archetype can be found in the Maven - Guide to Creating Archetypes . The ...
-
Previously, I posted an example of how to use JSF 1.2 with form based authentication (j_security_check). In this example, I use JSF 2.x to...
-
Abstract A common use case is to iterate over a collection of elements, and display them on a page. In the world of JSP, we would use a Ja...
3 comments :
I hope this young programmer will not put all them code in one file after this advice :)
If he put them in his code... I would laugh... and then kill him for doing it.
Here are my thoughts on it. Just because you can create this strange assortment of interfaces, and inner classes does not mean you should.
There are cases where you might use an interface that is private, and the inner classes which are in the example are often seen as listeners.
However, if I came across this code in production I would fix it, or make the person who did it fix it.
I do a Java Certification Boot Camp where I have code like this though. It is instructional. ;-)
Interesting.............
Post a Comment