Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

explain Anonynous inner class?

Answer Posted / preetesh

An Anonymous class is an inner class that is not assigned a
name. It is defined and instantiated within arguments of a
method of the Outer Class.

Syntax is as follows:
----------------------
public class OuterClass
{
//some relevant code

methodName(new ClassName(){ }); /*It indicates compiler
that the code between the braces in the argument of the
method defines an anonymours inner class.*/
}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the static block?

1011


What is the difference between compare and compareto in java?

957


Is map ordered in java?

888


What is use of arraylist in java?

1109


What are use cases?

915


What if constructor is protected in java?

1036


What is difference between protected and private?

1006


What is encapsulation in java?

1057


What is split return?

938


What is an exception in java?

1072


Does java runtime require a license?

992


Can we execute a program without main?

970


Why is java called the platform independent programming language?

959


Is null keyword in java?

893


How to instantiate static nested classes in java?

1024