Java
interface Book
{
void Show();
}
Java
Book my = new Book() {
public void Show() {
System.out.println("Alexandre Dumas: Count of Monte Cristo");
}
};
Java
Creating a new Java console application ... and write the code
interface Book
{
void Show();
}
public class Main {
public static void main(String[] args) {
Book my = new Book() {
public void Show() {
System.out.println("Alexandre Dumas: Count of Monte Cristo");
}
};
// Now we can call the Show method
my.Show();
}
}