15.3 Inner Nested and Anonymous Class

June 3, 2020



Inner nested class:
Inner class is the most important type of nested class. An inner class is a non-static nested class.
It has access to all of the variables and methods of its outer class.

Anonymous Class:
An anonymous inner class is one that is not assigned a name.

Check out our website:

Follow Telusko on Twitter:

Follow on Facebook:
Telusko :
Navin Reddy :

Follow Navin Reddy on Instagram:

Subscribe to our other channel:
Navin Reddy :
Telusko Hindi :

Subscribe to the channel and learn Programming in easy way.

Java Tutorial for Beginners:

C Tutorial Playlist :

Android Tutorial for Beginners Playlist :

XML Tutorial :

Design Patterns in Java :

Socket Programming in Java :

Spring MVC Tutorial :

OpenShift Tutorial for Beginners :

Spring Framework with Maven :

Sql Tutorial for Beginners :

String Handling in Java :

Array in Java :

Java Servlet :

Exception Handling in Java :

Nguồn: https://altcommtechniques.com

Xem thêm bài viết khác: https://altcommtechniques.com/game/

All Comments

  • the class does have name its still B isnt it? you sais B b = new B(){}. and what if u want to go back to using og implementation?

    priot shee June 3, 2020 4:59 am Reply
  • I think people find this hard to understand because of the naming anonymous.
    Basically all that is happening is you override the method or variable as the object is created,
    rather than going into the class and changing it.
    People just struggle to connect what is happening with the naming anonymous class.

    F3RDI June 3, 2020 4:59 am Reply
  • .Your other video is good ,Explanation is not so good

    Elumalai Vairamany June 3, 2020 4:59 am Reply
  • so much lag…

    Satoshi Nakamoto June 3, 2020 4:59 am Reply
  • Hi naveen, what about if your anonymous class has a variable e.g. int j just above public void show)? can that be accessed once you have declared the object e,g, obj.i ? thanks

    XTUBER010 June 3, 2020 4:59 am Reply
  • Hi Naveen. I guess we can create Class inside a method too. Try adding a small video on it.

    Vijay Kumar June 3, 2020 4:59 am Reply
  • HI Navin Your tutorials are great! but please make new videos into these kind of annoying screen captured recordings.. its very difficult to Watch these ones.

    Isuru Madushanka June 3, 2020 4:59 am Reply
  • In anonymous class how to call show() method with hello message? Do we need to create another object.

    Rahul Vishwakarma June 3, 2020 4:59 am Reply
  • if i have an interface which have a class then how i make the object of that class???

    shubham kumar June 3, 2020 4:59 am Reply
  • B obj=new B();{
    public void show(){
    System.out.println("Hi");
    }
    };
    obj.show();

    After defining the class in block is it necessary to call the class (obj. show()) ?

    Davis Nayak June 3, 2020 4:59 am Reply

Leave a Reply

Your email address will not be published. Required fields are marked *