In this example, We are going to convert number to words.
The following program takes the two static array of Strings . Here, we are going to make a method in which a parameter of integer type is passed. After that this program is going to create an another method of name convert() . In the main class create an object, and pass the value in object (num) . It displays the string representing the number.
Here is the code of this program:
Output of this program.
words is :=zero
words is :=One
words is :=Nine
words is :=One Hundrad
If you enjoyed this post then why not add us on Google+? Add us to your Circles
Liked it! Share this Tutorial