Is it possible to write method inside method
Answers were Sorted based on User's Feedback
Answer / divya
no,it's not possible to write method inside a method.it
will gives an error illigal starts of expression
| Is This Answer Correct ? | 18 Yes | 4 No |
Answer / janeesh
it is possible to write a method inside a method by using
method local inner classes.
Eg:
class Outer {
public void display() {
System.out.println("This is outerclass method.");
class Inner{
public void displayInner()
{
System.out.println("innerclass method");
}
}
Inner objC = new Inner();
objC.displayInner();
}
}
class MethodeInsideMethod {
public static void main(String[] args) {
Outer objC = new Outer();
objC.display();
}
}
Output:
This is outerclass method.
innerclass method
| Is This Answer Correct ? | 11 Yes | 5 No |
Difference between final and effectively final ? Why is effectively final even required ?
What are the 3 types of loops in java?
Can anonymous class have constructor?
what is the difference between AWT and SWING what is the advantage of using swing?
What is ResourceBundle class?
Difference between Application and Applet ?
Can you override a final method?
what is object slice?
String is mutable or immutable?
Can we use String with switch case?
Explain access specifiers?
0 Answers Thomson Reuters, Virtusa,
Create a form of user Login in JSP, that accepts the user name and password from user and authenticate it with user names and passwords stored in database. (Plz provide me answer immediately)