Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Java (https://www.askmehelpdesk.com/forumdisplay.php?f=440)
-   -   Having difficulty with Java String (https://www.askmehelpdesk.com/showthread.php?t=772530)

  • Oct 24, 2013, 06:16 AM
    BritishBulldog
    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);

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

  • All times are GMT -7. The time now is 01:25 PM.