Showing posts with label Anonymous Object in JAVA. Show all posts
Showing posts with label Anonymous Object in JAVA. Show all posts

Anonymous Object in JAVA

Anonymous Object in JAVA

class A  {

int k;

A(int m)  {
k=m;
}

int getK() {
  return k;
}

}


class TestDemo {

public static void main(String s[])  {

System.out.println(new A(10).getK());

}

}

Watch Following Video to Learn in Detail :