-1

Eclipse is throwing the error :

"MidiSystem.getSequencer cannot be resolved to a type"

I am running JavaSE- 1.7 with compliance level 1.7

Not sure what is going on here

import javax.sound.midi.*;
public class drumKit{

    public void play(){
        try{
            Sequencer sequencer = new MidiSystem.getSequencer();
            System.out.println("got it");
        }
        catch(MidiUnavailableException ex){
            System.out.println("Cannot find");
        }
   }

    public static void main(String[] args){
        drumKit d = new drumKit();
        d.play();
   }
}
Dharmesh Porwal
  • 1,406
  • 2
  • 12
  • 21
Keller Waldron
  • 25
  • 1
  • 1
  • 5

1 Answers1

0

getSequencer() is a static method , no need to use the new keyword

public void play(){
    try{
        Sequencer sequencer = MidiSystem.getSequencer();
        System.out.println("got it");
    }
Abhishek
  • 878
  • 12
  • 28