Skip to content

Instantly share code, notes, and snippets.

@tmountain
Created March 4, 2010 21:22
Show Gist options
  • Save tmountain/322128 to your computer and use it in GitHub Desktop.
Save tmountain/322128 to your computer and use it in GitHub Desktop.
travis@travis-desktop:/tmp/menu$ cat MenuItem.java
class MenuItem {
private String item;
public abstract void run();
public MenuItem(String item) {
item = item;
}
}
travis@travis-desktop:/tmp/menu$ cat Base.java
public class Base {
private MenuItem menuSearch = new MenuItem("Search") {
public void run() {
System.out.println("Item -> " + item);
}
};
public void main(String[] args) {
Base b = new Base();
}
}
MenuItem.java:1: MenuItem is not abstract and does not override abstract method run() in MenuItem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment