# StrictMath multiplyFull() method in Java with Examples

The multiplyFull(int x, int y) method of StrictMath class is used to return the exact mathematical product of the two arguments. In the parameters, two integer values are provided and the product of both numbers expressed in long type returned by this method.

Syntax:

`public static long multiplyFull(int x, int y)`

Parameters: This method accepts two Integer x, y as parameter where x and y are arguments to be multiplied.

Return Value: This method returns long type value which is exact product of X * Y.

Note: This method is added in JDK 9. Hence it won’t run on Online IDE.

Below programs illustrate the multiplyFull() method:

Program 1:

 `// Java program to demonstrate ` `// multiplyFull() method of StrictMath class ` ` `  `public` `class` `GFG { ` ` `  `    ``// Main method ` `    ``public` `static` `void` `main(String[] args) ` `    ``{ ` ` `  `        ``// two Integer values ` `        ``int` `a = ``367428``, b = ``1374``; ` ` `  `        ``// apply multiplyFull method ` `        ``long` `c = StrictMath.multiplyFull(a, b); ` ` `  `        ``// print result ` `        ``System.out.println(a + ``" * "` `                           ``+ b + ``" = "` `+ c); ` `    ``} ` `} `

Output:

```367428 * 1374 = 504846072
```

Program 2: Multiplying two integers contains Integer.MAX values.

 `// Java program to demonstrate ` `// multiplyFull() method of StrictMath class ` ` `  `public` `class` `GFG { ` ` `  `    ``// Main method ` `    ``public` `static` `void` `main(String[] args) ` `    ``{ ` ` `  `        ``// two Integer values ` `        ``int` `a = Integer.MAX_VALUE; ` `        ``int` `b = Integer.MAX_VALUE; ` ` `  `        ``// apply multiplyFull method ` `        ``long` `c = StrictMath.multiplyFull(a, b); ` ` `  `        ``// print result ` `        ``System.out.println(a + ``" * "` `                           ``+ b + ``" = "` `+ c); ` `    ``} ` `} `

Output:

```2147483647 * 2147483647 = 4611686014132420609
```

Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.

My Personal Notes arrow_drop_up Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Improved By : Akanksha_Rai

Article Tags :
Practice Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.