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 are the benefits of detached objects?

0 Answers  


What is ioc concept & explain it?

0 Answers  


What is resource bundle?

1 Answers  


what is default length of textfield ?

1 Answers  


What is MOM?

1 Answers   Wipro,


In howmany ways a thread can be created?

3 Answers   HCL,


What are skeletons and stubs and how they are generated?

2 Answers  


For which statements does it make sense to use a label?

0 Answers  


Explain Life cycle of Servlet Filter.

2 Answers   InfoBrain, ITC Infotech,


which is the better collection class if the requirement is only displaying the data

1 Answers  


what is JTS?

1 Answers  


what is the use of Object Factories?

1 Answers  


Categories