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?
d4n0wnz 0 Newbie Poster
Recommended Answers
Jump to PostCan'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.
Jump to Post>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.
All 7 Replies
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
Vilice -2 Junior Poster in Training
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
ChaseVoid 30 Junior Poster
Vilice -2 Junior Poster in Training
ChaseVoid 30 Junior Poster
Vilice -2 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.