Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Is it possible to write method inside method

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the current version of java?

1084


What is parsing and its types?

1178


Does A Class Inherit The Constructors Of Its Superclass?

1133


Is an array a vector?

1117


Can you extend main method in java?

1251


What is the difference between static binding and dynamic binding?

1192


what is singleton class in java?

1103


What do you mean by stream pipelining in java 8?

1280


what is the use of bean managed and container managed with example?

2013


what r advatages of websphere? & how to deploy?

2256


What is the difference between Java1.4 and Java1.5

2382


What do the thread?class methods run() and start() do?

1074


What is serialversionuid?

1150


What's a method in programming?

1150


Difference between ‘>>’ and ‘>>>’ operators in java?

1172