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...


What is an anonymous class?



What is an anonymous class?..

Answer / sai

An anonymous class is a local class without a name. An
anonymous class is defined and instantiated in a single
succinct expression using the new operator.

Example:
class popcorn{
public void eat(){
syso("popcorn is sweet");
}
public void m1(){
syso("popcorm method");
}
class sample{
public static void main(String args[]){
popcorn p = new popcorn(){
public void eat(){
syso("popcorn is so hot");
}
};
p.eat();
p.m1();
}
}

Is This Answer Correct ?    17 Yes 3 No

Post New Answer

More Core Java Interview Questions

Explain the importance of thread scheduler in java?

0 Answers  


What does || || mean in math?

0 Answers  


Is there any difference between synchronized methods and synchronized statements?

0 Answers  


What do you mean by platform independence?

0 Answers  


What is subsequence of a string?

0 Answers  


What are concepts of OOPS and how are they implemented in Java?

2 Answers   KPIT,


How do generics work?

0 Answers  


How to override equals() and hashCode() method in java?

1 Answers   Wipro,


Does 'true' and 'false' are keywords?

5 Answers  


What is difference between protected and private?

0 Answers  


Why we use static and synchronized in method for single thread model example: public static synchronized add(){}

2 Answers  


What is an Exception ?

10 Answers  


Categories