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 |
How many layers are there in RMI and what are they?
Define the remote object implementation?
Why is string immutable in java?
What is synchronization?
What is bean? Where can it be used?
Name three component subclasses that support painting?
Why threads will block on I/O?
a US company has filed my H1B visa ,, and i got selected in random number process.I wanna ask Could they ask regarding my languages(java,c++) or there will b just general questions?? And wat kind of questions will they ask in embassy interview??
diff between jsp include directive and jsp action include?
What are the high-level thread states?
What is the RMI and Socket?
Can a thread be a member of another thread?