Results 1 to 2 of 2
Thread: Convert Recursive Method to Java
- 03-07-2011, 11:40 PM #1
Member
- Join Date
- Mar 2011
- Posts
- 1
- Rep Power
- 0
Convert Recursive Method to Java
I found a cool recursive method in Python, I'd like to use it in Java. Here's the link: Ideone.com | Online Python Interpreter & Debugging Tool
Any idea how I can use this and play with it in Java?
- 03-08-2011, 01:38 AM #2
Senior Member
- Join Date
- Mar 2010
- Posts
- 953
- Rep Power
- 4
I'll get you started:
Give it a try, and post what you come up with.Java Code:public class Diamond { public void displayDiamond(int stars) { displayDiamond(stars, 1); } public void displayDiamond(int stars, int spaces) { // TODO: write this part } public static void main(String[] args) { new Diamond().displayDiamond(5); } }
-Gary-
Similar Threads
-
Java class HashIt with a static recursive method and a static iterative method
By kezkez in forum New To JavaReplies: 3Last Post: 02-09-2010, 05:22 AM -
recursive method
By michail in forum New To JavaReplies: 0Last Post: 01-31-2010, 01:50 PM -
Java Recursive method problem
By kj2009 in forum Advanced JavaReplies: 2Last Post: 02-25-2009, 03:19 PM -
exercise of recursive method
By amexudo in forum New To JavaReplies: 2Last Post: 03-09-2008, 05:55 PM -
Recursive Method
By bluegreen7hi in forum New To JavaReplies: 5Last Post: 11-29-2007, 04:45 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks