java - What is use of user defined marker interface -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 8 जवाब
  • 5 जवाब

    मान लीजिए कि मैं मार्कर इंटरफ़ेस Kiran बनाया है और मैं इस इंटरफेस का उपयोग कैसे कर सकता हूँ मुझे पता है कि यह क्रियाओं के लिए इस्तेमाल किया जाता है लेकिन मार्कर इंटरफ़ेस घोषित करने का क्या उपयोग होता है।

      सार्वजनिक इंटरफेस kiran {}    

    एक सामान्य उपयोग के मामले का परीक्षण करना है, यदि किसी वस्तु को इस इंटरफ़ेस से चिह्नित किया गया है:

      यदि (obj instanceof kiran) {// कुछ करें}    

Comments

Popular posts from this blog

c# - The item with identity 'Id' already exists in the metadata collection. Parameter name: item -

sql - PostgreSQL automatically update row at specific date -

jsp - No mapping found for HTTP request with URI with annotation config Spring MVC and Jetty -