0

I'm trying to write a recursive method that will print a char c, x amount of times on the same line. I was thinking that I could return the recursive function call and concatenate the char c but I don't think my compiler agrees. What exactly are the properties of chars and how can I go about doing this?

4
Contributors
7
Replies
8
Views
9 Years
Discussion Span
Last Post by Vilice
0

Can't you just store the values on a String and then accept a value for the count of recursion. Call the method passing the String and Integer.

If you must use a char data type, then is a simple typecasting.

0

I mean the superclass of the char .Or can extend other original data type , give it more function

0

>I mean the superclass of the char .Or can extend other original data type ,
>give it more function
Why do you want to bother doing all that stuff? When a simple typecasting is enough.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.