Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Printing multiple char strings

807598Nov 4 2006 — edited Nov 4 2006
I've only recently started my degree, and therefore, I am new to java.

I need to be able to print a character String multiple times on a single line in the consol window. The length needs to be defined by an Integer varible

For example:
str star = "*";

//How would I then print this String n amounts of time on the same line
//like -

int variable 10;
and the result to be:
**********
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 2 2006
Added on Nov 4 2006
5 comments
797 views