Win a copy of Microservices in Action this week in the Web Services forum!

Kasun Wixkramanayake

Ranch Hand
+ Follow
since Feb 09, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
7
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kasun Wixkramanayake

x(1)x(2)****x(3)*

Am i correct
4 years ago
Pawel Pawlowicz i follow your steps i can understand it but i have no idea how to write the rest of it.Please can you help me
4 years ago
Pawel Pawlowicz thank you.Can you explain little bit more what you mean by *
4 years ago
.i could not understand how this works on stack.it very confusing to me.
4 years ago
yeah i thank you.i could not understand how this works on stack.it very confusing to me.
4 years ago



can you guys tell me hoe this recursion print 3 2 1 2 1 3 2 1 2 1 3 2 1 2 1 if i call it with value 3. i need you show this work step by step.because i am new to java.thanks
4 years ago
hey joe i am not good in English can you explain it little bit more

So effectively, method10 has to be first evaluated. Now comparing this to your recursive function, the innermost loop which is satisfied until your i is less than n, that method returns a value (in your case nothing as you are just printing the value of n) and then the next method up in the stack gets evaluated until it reaches the top of the stack which is method1 in our analogy!

4 years ago
hey joe i am not good in English can you explain it little bit more
4 years ago
3 2 1 2 1 3 2 1 2 1 3 2 1 2 1 (if call this method with value 3
) i get this out put.I don't know how it comes can you explain it me
4 years ago
no i know how the recursion work but i don not know how recursion work inside a for loop
4 years ago


can you tell me how this recursion works.
4 years ago
thank you for your help.So do you think finalizer always run after the garbage collection
5 years ago
what do you mean by garbage collection order.Can you eloborate your answer
5 years ago
Hey thank you for your replies.So can we prevent this using Garbage collecor
5 years ago

promptly [JLS, 12.6]. It can take arbitrarily long between the time that an object
becomes unreachable and the time that its finalizer is executed. This means that
you should never do anything time-critical in a finalizer. For example, it is a
grave error to depend on a finalizer to close files, because open file descriptors are
a limited resource. If many files are left open because the JVM is tardy in executing
finalizers, a program may fail because it can no longer open files.
The promptness with which finalizers are executed is primarily a function of
the garbage collection algorithm, which varies widely from JVM implementation
to JVM implementation. The behavior of a program that depends on the promptness
of finalizer execution may likewise vary. It is entirely possible that such a
program will run perfectly on the JVM on which you test it and then fail miserably
on the JVM favored by your most important customer.


According to the above paragrph the using finalizers are not good programming practice.Can you explain why .This pargrapgh is hard to understand due to my poor english
5 years ago