Write a Java interface named Searchable with two abstract methods: one named Way2Search that returns a String and another named MaxTime that returns an Integer. Be sure your code compiles and runs as expected. Name your Java file Searchable.java.
Although there is no compilitation errors, or any errors throughout the program. I do feel like this is not the right way. Please, any assistance will help out.
Searchable.java
package searchable;
public class Searchable {
public static void main(String[] args) {
Search s = new Search() {
@Override
public void Way2Search(String Topic) {
System.out.print("How many times have the Packers won the Superbowl?");
}
@Override
public void MaxTime(int Number) {
System.out.print(" 4");
}
};
s.Way2Search("How many times have the packers won the superbowl");
s.MaxTime( 4);
}
}
Search.java
package searchable;
public abstract class Search {
public Search(){
System.out.print("Print: ");
}
public abstract void Way2Search(String Topic);
public abstract void MaxTime(int Number);
}