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
Which of the following is a use for a honeynet? A. Detecting network attacks and scans B. Slowing down attackers C. Concealing n
inn [45]

Answer:

A. Detecting network attacks and scans

Explanation:

Honeynet

It is a network , which is set up with the intentional vulnerabilities , in order to invite the attack , in order to determine and study the activities of the attacker .

The Honeynet is composed of one or more honey pots , which are just the computer systems , which act as a bait to trap the people who , tries to hack or penetrate into other's computer system .

Hence ,

The correct option is Detecting network attacks and scans .

5 0
3 years ago
A circular copper disk of diameter D=10 cm rotates at frequency =1800 rev/min about an axis through its center and at right angl
MAXImum [283]

Answer:

Induced current is 0.226 A

Explanation:

To calculate potential difference we have

E =1/2Bomega*r2 =1/2*1*1800*3.14*0.05=141.3

putting values we get

the p.d is 141.3

7 0
3 years ago
Device managment is the process of managing what kind of devices​
prisoha [69]

Mobile device management is a type of security software used by an IT department to monitor, manage, and secure employees' mobile devices (laptops, smartphones, tablets, etc.) that are deployed across multiple mobile service providers and across multiple mobile operating systems being used in the organization.

6 0
2 years ago
output device is any peripheral to provide data and control signal to ab information processing system​
nirvana33 [79]

Answer:

Its false ita not "output" its "input"

7 0
2 years ago
The events that happen in a story are called the _________________.
RUDIKE [14]

Answer: B) plot

Explanation:

4 0
2 years ago
Read 2 more answers
Other questions:
  • Opportunity cost is the least desirable alternative given up as a result of a decision.
    6·1 answer
  • In 125 words describe the steps to active listening.
    6·1 answer
  • You are called to assist in troubleshooting a network problem that has occurred soon after a significant IPv6 implementation. So
    11·1 answer
  • What are Important points to include about preventing the download of malware?
    14·1 answer
  • Instructions:Type the correct answer in the box. Spell all words correctly.
    9·2 answers
  • Is there any difference beetween the old version of spyro released on the origional and the newer ones??? or is it only change i
    8·1 answer
  • Which of the following technologies does NOT facilitate the transferring of data between computers in adjacent buildings?
    12·1 answer
  • Which of the following is a key aspect of any IT position? installation of fiber optic cables
    14·2 answers
  • AfcAAgrwdsgsFsefvzsdfvbjhbdjbbjbjsdndVHFadbhZJBVdb
    10·2 answers
  • Differentiate between patent and copyright.
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!