1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Law Incorporation [45]
3 years ago
6

What is Recursion in Java?

Computers and Technology
1 answer:
wel3 years ago
6 0

Answer:

Recursion is a process of defining a method that calls itself repeatedly

Explanation:

Recursion is a basic programming technique of defining a method that calls itself repeatedly.

One practical example is using recursion to find the factorial of a number.

Consider the following java code below, it uses recursion to solve for the factorial of a number.

class Main {

   public static void main (String[] args) {

       System.out.println("Factorial of 3 is " + factorial(3));

       System.out.println("Factorial of 5 is " + factorial(5));

       System.out.println("Factorial of 7 is " + factorial(7));

   }

   //the factorial method uses recursion to find the factorial of the

   // parameter of the integer pass into it

   

   private static int factorial(int n) {

       int result;

       if ( n ==1) return 1;

       result = factorial(n-1) * n;

       return result;

   }

}

You might be interested in
The technology Herman Hollerith created in the 1880s began the modern-day data processing function in computers.
adell [148]

Answer:

Punch Card Machine

Explanation:

The punch cards or the punched cards are also termed as the Hollerith cards or we also know them as the IBM cards. And they happen to be the paper cards where holes can be punched with the help of the hands or with the help of the machine for representing the computer instructions or data. And these were used on quite a large scale for inputting the data when we talk of the early computers. And this technology was developed by the Herman Hollerith.

7 0
4 years ago
Which was the first arcade game that was adapted for mobile phones ????
natka813 [3]

The correct answer is Snake.

4 0
3 years ago
Universal Containers (UC) has a great user interface for their Customer Community Knowledge Base. UC has multiple Communities an
IrinaK [193]

Answer:D

Explanation:

Recreate the knowledge base page in all communities.

3 0
3 years ago
Compare and contrast between first and second generation of computer<br>​
noname [10]
Frist gen of computers took forever to load and would crash if someone els in the house picked up the phone now adays are computers are in our pockets. There our phones and they rarely if ever crash
8 0
3 years ago
What specialized computer program hides the differences in hardware and works a bridge between hardware and appilcations?
VLD [36.1K]

A. hope this helped.

3 0
4 years ago
Other questions:
  • The animation industry is solely reliant on 3-D modeling and 3-D virtualization to create the animated movies in the cinemas.
    9·2 answers
  • One day a subcontractor calls him saying that he needs a replacement check for the job he completed at 1437 Elm Street. Jonathan
    14·1 answer
  • A technician has been asked to troubleshoot a simple network problem that seems to be caused by software. Which troubleshooting
    7·1 answer
  • Why do nonprofit agencies include blogs on there website?
    10·1 answer
  • Please Help ASAP! 30 Points! Will Mark Brainliest! Please Don't Waste Answers! It's Due In 40 Minutes Please Help Me!
    12·1 answer
  • Give one example of where augmented reality is used​
    11·2 answers
  • Help me? ill do anything ill let u smash me or anything just HELP!
    15·2 answers
  • Create a script to input 2 numbers from the user. The script will then ask the user to perform a numerical calculation of additi
    7·1 answer
  • Difference between multi-national and global company​
    11·2 answers
  • There is a group of 10 people who are ordering pizza. If each person gets 2 slices and each pizza has 5 slices, how many pizzas
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!