![]() |
|
![]() |
| LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) |
| Junior Member Join Date: Nov 2006
Posts: 21
Thanks: 6
Thanked 0 Times in 0 Posts
Rep Power: 4 | Marker Interface Went thru a lot of threads, but not able to understand Marker Interface. The only way I can understand is by creating my own implementation of user defined Marker Interface. Please anybody give me a simple example of the same. Thank You. |
| | |
| | #2 (permalink) |
| Member Join Date: Jul 2008 Age: 32
Posts: 55
Thanks: 0
Thanked 9 Times in 7 Posts
Rep Power: 3 | Re: Marker Interface In java language programming, interfaces with no methods are known as marker interfaces. Marker interfaces are Serializable, Clonable, SingleThreadModel, Event listener. Marker Interfaces are implemented by the classes or their super classes in order to add some functionality. e.g Suppose the interface Clonable is neither implemented by a class named Myclass nor it's any super class, then a call to the method clone() on Myclass's object will give an error. This means, to add this functionality one should implement the Clonable interface. While the Clonable is an empty interface but it provides an important functionality. |
| | |
| | #3 (permalink) |
| Member Join Date: Jul 2008 Age: 32
Posts: 55
Thanks: 0
Thanked 9 Times in 7 Posts
Rep Power: 3 | Re: Marker Interface Marker interface is a Java interface which doesn't actually define any fields. It is just used to "mark" Java classes which support a certain capability -- the class marks itself as implementing the interface. For example, the java.lang. Cloneable interface. |
| | |
![]() |
| Tags |
| interface , marker |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| JAVA collection | naga | JAVA Technologies | 1 | 11-01-09 12:38 AM |
| JAVA Q&A part1 | naga | JAVA Technologies | 3 | 25-12-08 11:48 PM |
| question on marker interface | raghuvamshi_ece | JAVA Technologies | 2 | 09-10-07 07:53 PM |
| Abstract Classes versus Interfaces? | radhika743 | JAVA Technologies | 5 | 16-01-07 07:54 PM |
| interface objects | priya2k6 | JAVA Technologies | 1 | 06-09-06 01:16 AM |
| More Interview Questions Here... |