Results 1 to 6 of 6
Thread: System.out.println problem
- 10-05-2010, 06:35 PM #1
Member
- Join Date
- Sep 2010
- Posts
- 62
- Rep Power
- 0
System.out.println problem
Hi,
I am trying to view the current values of one variable during execution of a code.
But Eclipse says that this particular line is unreachable code. Does anybody know why?Java Code:public class TestSum { static double sum( int n ) { if( n == 1 ) return 1; else { return n*n + sum(n - 1)*sum(n-1); [COLOR="Red"]System.out.println(n);[/COLOR] } } }
- 10-05-2010, 06:39 PM #2
How can you do something after you've already returned from the method?
- 10-05-2010, 06:40 PM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,377
- Blog Entries
- 7
- Rep Power
- 17
- 10-05-2010, 06:45 PM #4
Member
- Join Date
- Sep 2010
- Posts
- 62
- Rep Power
- 0
Thanks for the replies.
Then how can I keep track of this variable during execution?
- 10-05-2010, 06:51 PM #5
Why can't you print it BEFORE the return?
- 10-05-2010, 07:45 PM #6
Member
- Join Date
- Sep 2010
- Posts
- 62
- Rep Power
- 0
Similar Threads
-
Println VS system.out.println
By ccie007 in forum New To JavaReplies: 2Last Post: 05-20-2010, 08:52 AM -
difference between system.out.println() & out.println()
By wickedrahul9 in forum Advanced JavaReplies: 5Last Post: 10-18-2008, 11:06 PM -
System.out.println
By Sniper-X in forum Advanced JavaReplies: 10Last Post: 05-05-2008, 03:41 PM -
System.out.println
By sunjavaboy in forum Advanced JavaReplies: 3Last Post: 03-22-2008, 01:30 AM -
Help me with system.out.println
By baltimore in forum New To JavaReplies: 1Last Post: 07-31-2007, 08:30 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks