can we write implementation for a method with in another
method?

Answers were Sorted based on User's Feedback



can we write implementation for a method with in another method?..

Answer / sharan raj

Yes, a method can be implemented within another method
using anonymous class.
using anonymous class: new ClassName({...});
For more details regarding anonymous class refer any java
document.

Is This Answer Correct ?    29 Yes 4 No

can we write implementation for a method with in another method?..

Answer / sumitpalsingh

Yes,we can write one method implementation inside another method.

public class ImplementMethodEx {
public void m1(){
System.out.println("M1-Method Impl.");
}
public void m2()
{
m1();
}
public static void main(String[] args) {
ImplementMethodEx obj=new ImplementMethodEx();
obj.m2();

}

}

Is This Answer Correct ?    0 Yes 0 No

can we write implementation for a method with in another method?..

Answer / krish

No, you cannot implement a method in side a method.it gives
you a compile error.

Is This Answer Correct ?    5 Yes 18 No

Post New Answer

More Advanced Java Interview Questions

What is the difference between the string and stringbuffer classes?

0 Answers  


What is the purpose of the notifyall() method?

0 Answers  


What is abstract schema?

0 Answers  


What is UniCastRemoteObject and what is its use in RMI?

6 Answers  


What are preemptive scheduling and time slicing and what is the difference between them?

1 Answers  






What are externizable interface?

0 Answers  


the advantages of polymorphic

1 Answers  


What is the highest-level event class of the event-delegation model?

0 Answers  


Explain about thread synchronization inside a monitor?

0 Answers   Saksoft,


What is ioc concept & explain it?

0 Answers  


What class is the top of the awt event hierarchy?

0 Answers  


How two threads will communicate with each other?

2 Answers  


Categories