Ask Experts Questions for FREE Help !
Ask
    BritishBulldog's Avatar
    BritishBulldog Posts: 1, Reputation: 1
    New Member
     
    #1

    Oct 24, 2013, 06:16 AM
    Having difficulty with Java String
    Can someone please me how I can write a Java code to transform the quantity 6 As into the string AAAAAA. I'm trying this, but it does not work:

    public class Letters {

    public static void main (String[] args) {

    String words=" ";
    String numberofwords="A";
    int wordcount=6;

    for (int I = 0; I < wordcount; I++) {

    words += numberofwords;

    }

    System.out.println ("the letters are : + words);

    }
    Scleros's Avatar
    Scleros Posts: 2,165, Reputation: 262
    Hardware Expert
     
    #2

    Nov 30, 2013, 09:26 AM
    You are missing a quote.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Java netbeans program- Connection between java and mysql,How to conn [ 0 Answers ]

which I wrote from a book but when I run it, it shows exception please give me the code to connect jlistbox to database when I click on btn1. btn coding should search "name" in database and shows all the names in listbox my coding: here-- r1,r2,r3 are radio btns and l1,l2,l3 are labels,...

3 yr old difficulty urinating [ 1 Answers ]

My 3 yr old daughter has had very pungent urine for a few weeks. Despite changing what she drinks it persists. Today she has only been to the bathroom twice with very little output. She has also had nausea and vomiting. My family has a history of kidney related diseases. Do I need I take her to the...

Difficulty in booting [ 1 Answers ]

I am using windows XP sp3. Last week suddenly my system stopped booting. Everything on the system was updated.Virus,programs updates. When I start the boot, it says boot from CD then nothing comes for hours. Then I tried changing the boot from prefernce to hard disk.it didn't help. Then I changed...

New string in string Trimer [ 1 Answers ]

How do I put new string in string Trimer. Bump Type kevant


View more questions Search