Answer Posted / 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 View All Answers
What is the history of java?
what is the messsage u r going to get from an objectoriented programing?
Can we declare the main method of our class as private?
Explain about collection interface in java?
What does %4d mean in java?
What is a method header?
Is array primitive data type in java?
Why Set interface contains unique elements, what internally implemented for this so that it contains unique elements?
What is exception propagation?
What is the integer of 16?
Does anyone still use java?
Explain what is Marker interface?
What is the indent key?
What is difference between iterator and enumeration in java?
Write an algorithm program in java for the following question.. In a VLSI design techniques,they used rectangles to design circuits. EVery rectangle is to be placed according to x,y coordinates. Check whether or not two rectangles overlap each other. Here overlapping of rectangles is acceptable, if 1) one rectangle intersect with other. 2) one rectangle fully covers other. The time of algorithm should not exceed o(n logn).