title: How can you multiply a string with an integer in Java?
body: <p>I was just writing code for project that's due for class but I'm having a problem because I need to multiply my string with a number. Here's parts of my code</p>
  
  <pre><code>int shoes=50;
  int shirts=30;
  int shorts=75;
  int caps=15;
  int jackets=100;
  </code></pre>
  
  <p>Those above are the products and how much they cost in dollars:</p>
  
  <pre><code>    System.out.print("Enter the product: ");
  String product=keyboard.nextLine();
  System.out.print("Enter the quantity of the product");
  int quantity=keyboard.nextInt();    
  System.out.print("cost= +product+*+quantity+");
  int cost= product*quantity;
  </code></pre>
  
  <p>This is the error I'm having:
  The operator * is undefined for the argument type(s) string, int</p>
  
  <p>Any suggestions?</p>