Solved .....
Printable View
Solved .....
When returning a boolean is going to solve the problem why you are telling not to use Boolean?
is the below code is not going to solve your prob ?
Code:int count = 0;
fun A(){
fun B();
******
if(count > 0)
System.out.println("java rocks !!!!!");
******
}
funB () {
if("Checking some condition") {
++count;
funA():
}else {
exit;
}
Using finally block to kill the instance is gonna help ?
There is no such thing (really) as the "previous instance of A()".
The previous instance of A() is up the call chain, so where you are in the code is already the previous instance of A(). (Instance is a poor choice of term here, because that is used to mean an instance of a clas in Java).
So if killing off the previous instance (if that were possible, or even made sense) would actually result you're current bit of execution being killed off. A bit like cutting off the rope you are hanging off, several feet above your head.
There is no such thing as "initialization of the function".
It's meaningless.
Without knowing what the problem is that you think this is solving, it's rather difficult to actually help. Because whatever it is you're trying makes no sense with how Java (and most code) works.
The only way you can prevent A() from calling B() if it is B() that called A() is to use a flag as shown above by arun, that is set in B().
Why delete the posts?
Makes me look like a loon!
:)