can we write implementation for a method with in another
method?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
whats is mean by filter?
How to deploy Jar, War files in J2EE?
what is a Daemon Thread?
What is glasgow?
Is the session factory thread safe?
Is there a guarantee of uniqueness for entity beans?
Should synchronization primitives be used on bean methods?
What is a thread?
what is the Scope of Final Keyword in Java?
how to make a index.jsp for running the site in internet and find an error for connection with weblogic server and java that give an error invalid object name.and how to maintain session.
For which statements does it make sense to use a label?
diff mvc1 and mvc2 wahts is mean by servlet chaining?