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

Why are getters and setters used?

1058


Is boolean a data type in java?

961


What are the main uses of java?

992


How do you make an arraylist empty in java?

923


What is a parameter example?

977


Can a class be private in java?

993


What is a lambda expression ? What's its use ?

1103


What is the purpose of garbage collection in java, and when is it used?

1039


What is unicode with example?

1207


What is nested loop? What is dangling else condition in it?

1080


What is nullpointerexception in java?

1151


Can we override the overloaded method?

1143


Can we declare array without size in java?

1037


What is off heap memory?

1005


What is treeset in java?

999