public interface Happy {
String message();
}
public class Year implements Happy {
public String message() {
return "Happy New Year!";
}
public static void main(String[] args) {
Happy happy = new Year();
System.out.println(happy.message());
}
}
$> javac Happy.java
$> java Happy
Happy New Year!
$>
String message();
}
public class Year implements Happy {
public String message() {
return "Happy New Year!";
}
public static void main(String[] args) {
Happy happy = new Year();
System.out.println(happy.message());
}
}
$> javac Happy.java
$> java Happy
Happy New Year!
$>
No comments:
Post a Comment