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

What is class variable java?

0 Answers  


What is string data?

0 Answers  


What is a boolean field?

0 Answers  


What is immutable in java?

0 Answers  


What is the generic function?

0 Answers  


Give few examples of final classes defined in Java API?

0 Answers   BirlaSoft,


Can we place the any object to key attribute of HashMap<key,value>?

4 Answers   HCL,


How TreeMap sorts the objects inside it?? suppose if have include one employee object and one car object. On what basis it will sort?

5 Answers  


What is byte code and why is it important to java’s use for internet programming?

0 Answers  


What is the purpose of return statement?

0 Answers  


How will you measure that int takes up only 32 bits in memory?

2 Answers   Rolta,


What is data type in computer?

0 Answers  


Categories