• Like
  • Save
Interfaces In Java
Upcoming SlideShare
Loading in...5
×
 

Interfaces In Java

on

  • 4,594 views

 

Statistics

Views

Total Views
4,594
Views on SlideShare
4,426
Embed Views
168

Actions

Likes
1
Downloads
90
Comments
1

8 Embeds 168

http://www.ustudy.in 109
http://indijava.in 25
http://www.indijava.in 13
http://qsrealm.blogspot.com 8
http://ustudy.in 8
http://www.slideshare.net 2
http://www.techgig.com 2
http://static.slideshare.net 1
More...

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • I want to download this slide, Even I cant able to view it .
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Interfaces In Java Interfaces In Java Presentation Transcript

    • Interfaces Presented By Parag Shah http://www.adaptivelearningonline.net
    • Agenda
      • Java and multiple inheritance
      • Declaring interfaces
      • Using interfaces
    • 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
    • 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
    • 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();
      • }
    • 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]
    • Marker Interfaces
      • Some interfaces are used as flags for the JVM
        • Cloneable
        • Serializable
        • SingleThreadModel
    • 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