Plan your text ad campaign.
Web hosting directory, find affordable web hosting
Data recovery software tools & file recovery utilities to recover lost data
WestNIC provides reliable web hosting services
This answer is part of the Code Style premium content package. You must have a premium content subscription to log in and view the full answer to this question. Use the premium content subscription form below.
A: A recursive method is one whose method body includes a call to itself, so that it is called repeatedly until an expected condition is met or it cannot continue the recursion any longer. These methods often take an object or numeric argument that is subject to progressive interrogation or mathematical processing at each pass. Recursive methods must be designed carefully to ensure that they do not result in a very deep or endless recursion, which is likely to cause an OutOfMemoryError.
A simple example of a recursive method is the getNodeByName(String) method below, which iterates through all child nodes in an object structure until it finds one that matches, or returns null.
More details available to premium content service subscribers:
What is a recursive method?
You must make a subscription payment to access areas flagged premium content. Use the form below to create an account via PayPal.
The PayPal service allows you to pay securely and independently in your own currency. Payments are billed to Metacentric Internet Limited. We never handle your credit card details.
The Code Style site has accumulated 8 years' worth of answers to the most common Web development questions. Answers are written in clear English with examples and links to other Web resources. Your subscription provides full answers to all premium content questions listed below and other FAQ sections, plus:
double up to an int?
NumberFormatException back to the main() method?
LinkedList dictionary?
println overloading or overriding?
public static void main(String[]) mean?
equals and ==?
hashCode() used?
NullPointerException in Java?
Rectangle on a Graphics instance?
new operator?
Class.forName() method and the new operator?
Class.forName() scheme?
newInstance()?
Class.forName() runtime polymorphism?
Class.forName(dbDriver) work with DriverManager.getConnection?
StringBuffers match?
StringBuffer?
StringTokenizer for?
Statement and PreparedStatement?
PreparedStatement?