What is Marker Interface

What is Marker Interface:

  • The interface without any member is called Marker Interface.
  • It is just an empty interface.
  • The uses of Marker Interface is to send the special message to JVM about the class
Example of Marker Interface:

when we want to make a clone of any class object then we need to send the instruction to JVM that class is eligible for cloning. we can do this by implementing the marker interface.

Interface



package com.javaforecast4u.file;

public interface JFCUCloneable {

}

 Class implemented this interface



package com.javaforecast4u.file;

public class Employee implements JFCUCloneable{
      
       int empId;
       Employee(int empId){
              this.empId = empId;
       }
       public Employee empClone() throws CloneNotSupportedException {
              if(this instanceof JFCUCloneable){
                     return new Employee(empId);
              }
              else{
                     throw new CloneNotSupportedException("Clone Not support ");
              }
       }
}

Test Class
 

package com.javaforecast4u.file;

public class MarakerInterfaceTest {

       public static void main(String[] args) throws CloneNotSupportedException{
             
              Employee emp = new Employee(1001);
              System.out.println("EmpId:"+emp.empId);
              Employee emp1 = new Employee(emp.empId);
              System.out.println("EmpId:"+emp1.empId);
              System.out.println(emp == emp1);
             
       }

}


OUTPUT:
EmpId:1001
EmpId:1001
false


31 comments :

  1. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    Android training in chennai
    Ios training in chennai

    ReplyDelete
  2. Thank you for posting, its a nice post and very useful.
    Best Oracle Training in Bangalore

    ReplyDelete
  3. I really appreciate the information shared above. It’s of great help. If someone wants to learn Online (Virtual) instructor lead live training in #ALFRESCO, kindly contact us http://www.maxmunus.com/contact
    MaxMunus Offer World Class Virtual Instructor-led training on #ALFRESCO. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ pieces of training in India, USA, UK, Australia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain, and UAE etc.
    Avishek Priyadarshi
    MaxMunus
    E-mail: avishek@maxmunus.com
    Skype id: avishek_2.
    Ph:(0) 8553177744 / 080 - 41103383
    http://www.maxmunus.com/

    ReplyDelete
  4. Really thanks for sharing such a great information with us.
    Also, many thanks for permitting me to comment!
    Quicken Support Number
    Quicken Online Support Number
    Quicken tech Support Number
    HP Support Number

    ReplyDelete
  5. Great work. Quite a useful post, I learned some new points here.I wish you luck as you continue to follow that passion.

    Linux Admin Training
    Linux Training in Chennai

    ReplyDelete
  6. Thanks for the informative article. This is one of the best resources I have found in quite some time. Nicely written and great info. I really cannot thank you enough for sharing.

    rpa training in marathahalli

    rpa training in btm

    rpa training in kalyan nagar

    rpa training in electronic city

    rpa training in chennai

    rpa training in pune

    rpa online training

    ReplyDelete
  7. This is a nice article here with some useful tips for those who are not used-to comment that frequently. Thanks for this helpful information I agree with all points you have given to us. I will follow all of them.

    Data Science training in chennai
    Data science training in velachery
    Data science training in tambaram
    Data Science training in OMR
    Data Science training in anna nagar
    Data Science training in chennai
    Data science training in Bangalore
    Data Science training in marathahalli

    ReplyDelete
  8. That was a great message in my carrier, and It's wonderful commands like mind relaxes with understand words of knowledge by information's.
    python online training
    python training in OMR
    python training in tambaram
    python training in annanagar

    ReplyDelete
  9. This is most informative and also this post most user friendly and super navigation to all posts... Thank you so much for giving this information to me.. 
    Devops Training in pune
    Devops Training in Chennai
    Devops training in sholinganallur
    Devops training in velachery
    Devops training in annanagar
    Devops training in tambaram

    ReplyDelete
  10. At this time, it seems like Word Press is the preferred blogging platform available right now. (from what I’ve read) Is that what you’re using on your blog? Great post, however, I was wondering if you could write a little more on this subject?
    Best AWS Training in Marathahalli | AWS Training in Marathahalli
    Amazon Web Services Training in Anna Nagar, Chennai |Best AWS Training in Anna Nagar, Chennai

    ReplyDelete
  11. myTectra Placement Portal is a Web based portal brings Potentials Employers and myTectra Candidates on a common platform for placement assistance

    ReplyDelete
  12. Hmm, it seems like your site ate my first comment (it was extremely long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog. I as well as an aspiring blog writer, but I’m still new to the whole thing. Do you have any recommendations for newbie blog writers? I’d appreciate it.
    Best Selenium Training in Chennai | Selenium Training Institute in Chennai | Besant Technologies


    ReplyDelete
  13. Amazing article. Your blog helped me to improve myself in many ways thanks for sharing this kind of wonderful informative blogs in live. I have bookmarked more article from this website. Such a nice blog you are providing ! Kindly Visit Us @ Best Travels in Madurai | Tours and Travels in Madurai

    ReplyDelete
  14. Very well written blog and I always love to read blogs like these because they offer very good information to readers with very less amount of words....thanks for sharing your info with us and keep sharing.
    python training in chennai | python training in chennai | python training in bangalore

    ReplyDelete
  15. The knowledge of technology you have been sharing thorough this post is very much helpful to develop new idea. here by i also want to share this.
    excel advanced excel training in bangalore | Devops Training in Chennai

    ReplyDelete

  16. Greetings. I know this is somewhat off-topic, but I was wondering if you knew where I could get a captcha plugin for my comment form? I’m using the same blog platform like yours, and I’m having difficulty finding one? Thanks a lot.

    AWS Interview Questions And Answers

    AWS Tutorial |Learn Amazon Web Services Tutorials |AWS Tutorial For Beginners


    AWS Online Training | Online AWS Certification Course - Gangboard

    AWS Training in Toronto| Amazon Web Services Training in Toronto, Canada

    ReplyDelete
  17. Thank you for taking the time to provide us with your valuable information. We strive to provide our candidates with excellent care and we take your comments to heart.As always, we appreciate your confidence and trust in us
    Data Science Training in Indira nagar
    Data Science Training in btm layout
    Python Training in Kalyan nagar
    Data Science training in Indira nagar
    Data Science Training in Marathahalli | Data Science training in Bangalore

    ReplyDelete
  18. This is such a good post. One of the best posts that I\'ve read in my whole life. I am so happy that you chose this day to give me this. Please, continue to give me such valuable posts. Cheers!

    angularjs Training in btm

    angularjs Training in electronic-city

    angularjs online Training

    angularjs Training in marathahalli

    angularjs interview questions and answers

    ReplyDelete
  19. When I initially commented, I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get several emails with the same comment. Is there any way you can remove people from that service? Thanks.

    Advanced AWS Training in Bangalore | Amazon Web Services Training in Bangalore
    Amazon Web Services Training in Pune | Best AWS Training in Pune
    AWS Online Training | Online AWS Certification Course - Gangboard
    Top 110 AWS Interview Question and Answers | Advanced AWS interview Questions and Answers – AWS jobs

    ReplyDelete
  20. Howdy, would you mind letting me know which web host you’re utilizing? I’ve loaded your blog in 3 completely different web browsers, and I must say this blog loads a lot quicker than most. Can you suggest a good internet hosting provider at a reasonable price?
    Best AWS Amazon Web Services Training in Chennai | Best AWS Training and Certification for Solution Architect in Chennai
    Amazon Web Services Training in Tambaram, Chennai|Best AWS Training in Tambaram, Chennai

    ReplyDelete
  21. I was looking for this certain information for a long time. Thank you and good luck.
    online Python training
    python training in chennai

    ReplyDelete
  22. I am so proud of you and your efforts and work make me realize that anything can be done with patience and sincerity. Well I am here to say that your work has inspired me without a doubt.
    python training institute in marathahalli
    python training institute in btm
    Python training course in Chennai

    ReplyDelete