Interfaces In Java

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

1 comments

Comments 1 - 1 of 1 previous next Post a comment

  • + kanmanineela kanmanineela 3 years ago
    I want to download this slide, Even I cant able to view it .
Post a comment
Embed Video
Edit your comment Cancel

Favorites, Groups & Events

Interfaces In Java - Presentation Transcript

  1. Interfaces Presented By Parag Shah http://www.adaptivelearningonline.net
  2. Agenda
    • Java and multiple inheritance
    • Declaring interfaces
    • Using interfaces
  3. Java And Multiple Inheritance - 1
    • Java does not have multiple inheritance
    • Inheritance gives us two things
      • Code reuse
      • Ability to represent the object polymorphically as the super type
  4. Java And Multiple Inheritance - 2
    • Code reuse in multiple inheritance is risky
    • The ability to represent a class polymorphically as a type other than the superclass may be useful
    • Interfaces allow the latter but not the former
  5. Interfaces
    • Interfaces are defined with the interface keyword
    • Interfaces do not have any code
    • All attributes are public static final
    • public interface Ignorable {
    • public boolean isValid();
    • }
  6. Implementing An Interface
    • Any class can implement an interface
    • Use the implements keyword
    • A class can implement multiple interfaces
    • The class must implement all the methods declared in the interface
    • See [biz.adaptivesoftware.examples.interfaces]
  7. Marker Interfaces
    • Some interfaces are used as flags for the JVM
      • Cloneable
      • Serializable
      • SingleThreadModel
  8. Summary
    • Interfaces allow us to polymorphically represent a class as types across inheritance trees
    • Interfaces are implemented with the implements keyword
    • Do not CREATE interfaces for non standard use such as marker interfaces

+ paragparag, 3 years ago

custom

2032 views, 0 favs, 3 embeds more stats

More info about this document

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Go to text version

  • Total Views 2032
    • 1997 on SlideShare
    • 35 from embeds
  • Comments 1
  • Favorites 0
  • Downloads 19
Most viewed embeds
  • 24 views on http://indijava.in
  • 10 views on http://www.indijava.in
  • 1 views on http://static.slideshare.net

more

All embeds
  • 24 views on http://indijava.in
  • 10 views on http://www.indijava.in
  • 1 views on http://static.slideshare.net

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories