MethodAnanomous.java
package com.inner;
interface Test{
public String hello="testing";
void see();
void look();
}
class Test1{
public void welcome(Test tr){
System.out.println("test ttttttt "+tr.hello);
tr.see();
}
}
public class MethodAnanomous {
public static void main(String[] args) {
Test1 met=new Test1();
met.welcome(
new Test(){
public String hello="rterterteresting";
public void look() {
System.out.println("hhjhhhh");
}
public void see() {
System.out.println("seeeeeeee "+hello);
}
}
);
}
}
No comments:
Post a Comment