Mayur Malhotra

Greenhorn
+ Follow
since Mar 18, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mayur Malhotra

Hi,

I Know that marker interface is an empty iterface,then what I want to know is that how does a class implementing marker interface work,i.e.how does how does a class implementing marker interface say serializable know that what is the functionality of serialization?
15 years ago
Hi,

Can anyone please explain me what a marker interface is?
I will be very thankful in case you provide the following:
1)An example marker interface named as User?
1)Small example of a class which implements a User marker interface.
15 years ago
I thanks for detailed explanation about marker interface Your reply was excellent.
From your I think you want to make the point is that marker Interface has nothing special in it ,infact its just a tag or (we can say a flag or bechmark) to check before performing Operations like Serilizing or Cloning an object.Kindly let me know whether my view about marker interface is correct or not also do add any further explanation in case i missed something.
15 years ago
Hi thanks for the explanation but still I have small doubt in the code to implement Cloneable why we check for "this implements Cloneable" since its an empty interface so what difference it makes if we check or not check that whether the Object to be cloned implements Cloneable or not?Can you please clear my doubt?
15 years ago
Hi can you please send the link again as I need to cross-verify which link you asked me to refer
15 years ago
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?
16 years ago
In fact I just want you ask you whether my assumption or picture about marker interface is clear or not.But still i have a small doubt "Can we say the same idea of providing logic(in implementation class) is present for Standard Marker interface like Serializable and Cloneable or they also have something more added to them"?
16 years ago
So i say i 've created a marker interface i will create an empty interface and to check for what kind of functionality it provides we need to check by refletion in its implementation class?
16 years ago
But Can we Create our own Marker interface ,I mean does jvm allow us to do that or not?
16 years ago
Can you tell me what I can/cannot do with marker interfaces?
16 years ago
So in the same case where i will provide special functionality what my interface has to serve.Say i want to create a marker interface
Which does connection pooling?
16 years ago
Or Consider if i need to create a marker interface of my own then what all steps do i have to follow in order to inform jvm that I ahve Created a marker interface and not a simple blank interace?Or else I cannot create such a marker interface of my own???
16 years ago
I think now you are clear with my question i.e.

I mean to say If a create an empty interface then it wont serve purpose of marker interface so in order to make it a marker interface what I have to do to give an indication to jvm that this interface is not a normal empty interface its a marker interface?

Or Consider 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?
16 years ago
Ok I can check that :myObject instanceof Mayur to confirm whether my class implements my marker interface but 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 .can I have such a mechanism through my own marker interface if so how?
16 years ago
But how will the java or jvm knows that this interface

public interface Mayur {
}

is a marker interface.I mean how jvm will identify that any class which implements this interface must have some special capabilities like Serializabl e or Cloneable has.
16 years ago