logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology See What Others Are Saying!
  • Question
  • When should I use abstract classes and when should I use interfaces?


  • Correct Answer
  • Use Interfaces when? - You see that something in your design will change frequently - If various implementations only share method signatures then it is better to use Interfaces - You need some classes to use some methods which you don't want to be included in the class, then you go for the interface, which makes it easy to just implement and make use of the methods defined in the interface Use Abstract Class when? - If various implementations are of the same kind and use common behavior or status then abstract class is better to use - When you want to provide a generalized form of abstraction and leave the implementation task with the inheriting subclass - Abstract classes are an excellent way to create planned inheritance hierarchies They're also a good choice for nonleaf classes in class hierarchies 


  • More questions

    • 1. EXPLAIN has output with MATCHCOLS = 0. What does it mean?
    • Discuss
    • 2. The new product development process usually starts with

    • Options
    • A. idea generation
    • B. market strategy development
    • C. concept development
    • D. idea screening
    • Discuss
    • 3. How do you display last 5 records in DB2?
    • Discuss
    • 4. Managing the sales force : For a new salesperson, what are his training needs?
    • Discuss
    • 5. What is SPUFI?
    • Discuss
    • 6. How will u send data from a cobol file to db2 table?
    • Discuss
    • 7. What is buying forward?
    • Discuss
    • 8. What is Benchmarking?
    • Discuss
    • 9. In a DB2-CICS program which acts as co-ordinator and which is the participant?
    • Discuss
    • 10. Market survey means...........

    • Options
    • A. Market Research
    • B. Market Planning
    • C. Marketing Strategies
    • D. Market Monitoring
    • Discuss


    Comments

    There are no comments.

Enter a new Comment