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 an isolation level?

0 Answers  


What is abstract schema?

0 Answers  


What is the need of serialize?

2 Answers   Wipro,


wahts is mean by dynavalidatorform in struts/

0 Answers   SolutionNET,


What is JTS?

0 Answers  






What are the high-level thread states?

1 Answers  


what is a non-repeatable read?

0 Answers  


How is serialization used generally ?

3 Answers  


What is an abstract method?

0 Answers  


Difference between loadclass and class.forname?

0 Answers  


What is the return type of interrupt method?

2 Answers  


difference between Abstract and Interface?

2 Answers   HCL, Infotech,


Categories