if example i will enter a number and the output will be in words, how will i do the function?
ex.
Enter number1: 1
'' number2: 2
" number 3: 3
value= one hundred twenty three?
pls just the funtion..
Printable View
if example i will enter a number and the output will be in words, how will i do the function?
ex.
Enter number1: 1
'' number2: 2
" number 3: 3
value= one hundred twenty three?
pls just the funtion..
java don't have functions.
its called a method. Defining Methods (The Java™ Tutorials > Learning the Java Language > Classes and Objects)
That's probably about 100 lines of code. Give us a good reason to do your job for you.
there is not any inbuilt function for that.... you have to make your own code in that you have to check total number of digit and according to that u have to check so much condition ...
its very lenghthy
;)
but its not difficult......
Hello. How can I make getParameters(); function?
public class URL {
public static void main(String[] args) {
String letters = "something.com/prodhhhucta.aspx?product=1148117" +
"&category=69977611&page=2&x=30&catalog=19";
int i = letters.indexOf("?");
String output = letters.substring(i+1);
String delims = "&";
StringTokenizer st = new StringTokenizer(output, delims);
Vector v = new Vector();
while(st.hasMoreTokens())
{
String token = st.nextToken();
v.addElement(token);
}
Enumeration param = v.elements();
while(param.hasMoreElements())
{
System.out.println(param.nextElement());
}
}
}
*****************************************
This is my program. I want to add getParameters() function. But I don't know how can I do. Please help me. Thanks beforehand