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 |
Write a java program to find out the sum of harmonic series : 1 + ½ + 1/3 + ……… up to nth term , for any value of n.
what are JSP tags? what is difference between include action and directory?
How are commas used in the intialization and iteration parts of a for statement?
What does module-relative mean?
Why use POJO when I can use hashmap
how java is os independent language ?
which of the following authentication is stronger than the others? a. Http Basic b. Http DIGEST c. Form based
we use MainFrame and using os390 for operating system with DB2 data base in IRAN and interest programing with java and use webspere for world wide,please help me where i should start?
hi friends, i have done my BE(CSE)at 2011 then i have joined one company before they asked me 50k so i paid but now they telling no project here so we r going to close like that so now i need any job i have good knowledge in core java and j2ee(jsp,servlet,jdbc) so if u know any job pl help me
how to create Calculator GUI using Gridbaglayout as like as Window Calculator??????????? (Open calculator Go-->Run-->type calc-->Enter)
Can constructors be synchronized in java?
What are callback interfaces?