Results 1 to 2 of 2
  1. #1
    siluk is offline Member
    Join Date
    Jul 2012
    Posts
    5
    Rep Power
    0

    Default Question about interfaces!

    Well, I didn't get something about interfaces. I know interfaces have just abstract methods so they should be implemented by a class. I was working with the javax.sound.midi.* package, so i saw that there was an interface called Sequencer, and in the example I saw, it called the method open() of the Sequencer interface. But how can i call the method open() if this method isn't implemented yet. At least I didn't found any class that implements the Sequencer. So where's the implementation f these methods. I'm totally new to Java and I didnt get it, is there something I should know about it that I still don't know? Thanks a lot and sorry my bad english!

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default Re: Question about interfaces!

    Use the getSequencer() method of MidiSystem as described in "Obtaining a Sequencer" in the "Using Sequencer Methods" page of Oracle's Tutorial.

    getSequencer() returns some class or other that implements the Sequencer interface. Your code doesn't know or care what concrete class it is: it just uses the interface methods.

Similar Threads

  1. Replies: 2
    Last Post: 03-20-2012, 11:55 PM
  2. A question on Interfaces.
    By fatabass in forum New To Java
    Replies: 4
    Last Post: 01-28-2012, 01:00 AM
  3. Question on interfaces
    By fatabass in forum New To Java
    Replies: 16
    Last Post: 01-23-2012, 03:33 PM
  4. Interfaces
    By blug in forum New To Java
    Replies: 1
    Last Post: 11-19-2010, 05:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •