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 |
Why a client should be multithreading? Explain.
why we use main in java?
how java is os independent language ?
Explain phantom read?
Is jvm a overhead?
What is the O/P of the below Code Snippet ? And how does it imply the concept of call-by-value/call-by-reference. (Note : Pls ignore syntx errors) public class One { sop ("Into One--"); } public class Two extends One{ sop ("Into Two--"); } public class Home { One a; Two t; public static void main(argv[]) { sop ("In Home--"); sop(One.a); sop(Two.a); sop(One.t); sop(Two.t); } }
What is threadfactory?
What are different types of layout managers in java.awt package?
What is the purpose of the notify() method?
Is infobus easy to use?
What if the static modifier is removed from the signature of the main method?
What is serialization and de-serialization ?