InterAnanomous.java
package com.inner;
interface Ananomous1 {
public String test="hello";
public String test1="hello test1";
void test();
void welcome();
}
public class InterAnanomous{
public static void main(String[] args) {
Ananomous1 ana=new Ananomous1(){
String test="anan hello";
public void test() {
System.out.println("hello test --- "+test);
}
public void welcome() {
System.out.println("welcomeeeeeeeee --- "+test1);
}
};
ana.welcome();
ana.test();
System.out.println("testsssss "+ana.test);
}
}
No comments:
Post a Comment