answersLogoWhite

0


Best Answer

The definition of recursion states that each method call after the initial one must be influenced by the previous call (its results must depend on the results to previous calls).

While this can lead to a method calling itself in a non-recursive way, it seems that it is also a sign of poor coding style and hard to read methods.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can you non-recursively call a method you are currently in in Java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is systemgc in java?

A call to System.gc() will tell Java that you want it to run the garbage collector. Use of this method is discouraged, especially since Java can simply choose to ignore the call if it's not necessary.


What is the difference between paint and repaint methods of java?

The paint method is where actual painting occurs. If you want to change the way a Component is drawn, you should override this method. The repaint method typically just tells your Component that it should call its paint method as soon as it can. This is the method you should call to force a Component to update itself. The Java API warns not to ever directly call the paint method, mostly for efficiency reasons.


What is dynamic method dispatch in java?

dynamic method dispatch is a technique by which a call to a overridden method is solved at runtime rather than compile time..this is how java implements runtime polymorphism.


How do you call start method into run method?

In Java a Thread object has two methods that the programmer needs to know: start and run.run is where we put the code that we want to execute when the Thread begins.The start method is what tells the Java Virtual Machine that it should create a new thread and tell it to execute its run method.While you can make a call to thread.run() in order to execute the code in the run method, this will not actually make a new thread in the JVM, but will execute just like any normal method call.


What do you call java and javascript?

Well you get java as java and javascript as iava.

Related questions

How do you call main class with in main class in java?

We can't call a class. We always call a method in java.


What is systemgc in java?

A call to System.gc() will tell Java that you want it to run the garbage collector. Use of this method is discouraged, especially since Java can simply choose to ignore the call if it's not necessary.


How is a method called in java?

method header and method body There are two ways to call a method; the choice is based on whether the method returns a value or not.


What is method call in java?

Calling a method in Java is when you run code associated with a specific class, using the name of an instance object of a class, followed by the dot operator, followed by the name of the method, followed by the arguments of the method, enclosed in parentheses.


Can you refer static method from non static method in java?

Yes, it is possible to call a static method from a non-static method. However, it is not possible to call a non-static method from a static method without first having an instance to operate on.


What is the difference between paint and repaint methods of java?

The paint method is where actual painting occurs. If you want to change the way a Component is drawn, you should override this method. The repaint method typically just tells your Component that it should call its paint method as soon as it can. This is the method you should call to force a Component to update itself. The Java API warns not to ever directly call the paint method, mostly for efficiency reasons.


How do you call a method in Java?

It's when you take a object and run some code in the class of that object.


How do you call a method from inside the main method?

I assume the question is about Java. How you call a method from inside the main method depends on whether this is an instance method or a static method. To call an instance method, you need to have a valid instance. Say foo is an instance of class Foo, which was created inside the main method. Then to call the instance method implode() use foo.implode() To call the static method bar() of class Foo, use Foo.bar().


What is dynamic method dispatch in java?

dynamic method dispatch is a technique by which a call to a overridden method is solved at runtime rather than compile time..this is how java implements runtime polymorphism.


Can you create object in java at run time?

Yes, you just have to implement a method that creates a new object, and call it.


Explain delcaring a method in java?

A method is a group of commands that are executed when you invoke, or call, the method. It is often called a "function", a "procedure", a "subroutine" in other languages; but in OOP environments, the name "method" is used instead.


How do you call start method into run method?

In Java a Thread object has two methods that the programmer needs to know: start and run.run is where we put the code that we want to execute when the Thread begins.The start method is what tells the Java Virtual Machine that it should create a new thread and tell it to execute its run method.While you can make a call to thread.run() in order to execute the code in the run method, this will not actually make a new thread in the JVM, but will execute just like any normal method call.