I mean how jvm will identify that any class which implements this interface must have some special capabilities like Serializabl e or Cloneable has
[My Blog]
All roads lead to JavaRanch
what about if a class implements Serializable or Cloneable its not checking into it whether the class implements Serializable or not in fact it just makes Object of that class(which implements serializable) available for serailization.
if i need to create a Serializable1 interface of my own having the same functionality what actual Serializable has then what all steps do i have to follow?
There is nothing like trying, either you do it or you don't.
SCJP 1.5
If we take an example of a book shop where we find different type of books, in that suppose you want to display all the books which are related to Java then you can use marker interface there.
There is nothing like trying, either you do it or you don't.
SCJP 1.5
Originally posted by Mayur Malhotra:
Hi, can you give me a practical scenario where we have a need to create our own marker interface.
Originally posted by Mayur Malhotra:
By something more i mean to say Like a serilizable interface makes an object capable of serialization how it is done internally by jvm as if remember clearly I have not written any implementation class of serializable to check for instanceOf operator?So how jvm knows That serializable means something different from normal interface?
[My Blog]
All roads lead to JavaRanch
I wasn't selected to go to mars. This tiny ad got in ahead of me:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|