Java int FAQ - How to multiply two integers

Java FAQ: How do I multiple two integers (int) in Java?

Here's a quick example:

int i = 3;
int j = 4;
int k = i * j;
System.out.println("k = " + k);

The value of k here will be 12.

Add new comment

The content of this field is kept private and will not be shown publicly.

Anonymous format

  • Allowed HTML tags: <em> <strong> <cite> <code> <ul type> <ol start type> <li> <pre>
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.