answersLogoWhite

0


Best Answer

class Product

{

public static void main(String[] args)

{

int x=Integer.parseInt(args[0]);

int y=Integer.parseInt(args[1]);

int z=x*y;

System.out.println("product="+z);

}

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

class product {
public static void main(String args[])
{
int a=Integer.parseInt(args[0]);
int b=Integer.parseInt(args[1]);
int c=a*b;
System.out.println(c);
}
}




output
javac product.java
java product 2 3
6

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a java program to find product of two numbers using command line argument?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is a command argument?

Command line arguments are provided at the time of running the program. Example: Suppose that your program needs input name and its value then running it from commandline(DOS prompt) you provide the values after the program name java xyz name JAX(name is name and value is jax)


Please someone explain you command line argument in C?

Command Line Arguments---- I am trying to explain each word one by oneCommand ------perform specific taskex. When CMD is typed in run window and then press ok button then open a black screen that is called command prompt.Command Line ------on command prompt where command is supplied that is called command line.using command prompt dos commands are executed and java program is also executed using command prompt.for executing java program command is supplied with given syntaxjava java_class_name argument1 argument2.........Java--- is a commandjava_class_name ---name of java file which you want to executeargument1 argument2 --- are the values passing to java application from out sidethese argument1 argument2 are stored in string array argument of main method


How do you compile and execute Java program in which we find the highest of any five numbers?

In the same way as you would compile and execute any other Java program. Compile: use the "javac" command. Or use the built-in "compile" command in your favorite IDE. Execute: Use the "java" command. Or use the built-in "run" command in your favorite IDE.


What is command to compiler java program?

The command is "javac".


How do you start the display program in Linux from the command line?

the command "display" brings up the ImageMagick program.

Related questions

Command line argument?

Command line argument is a value that is passed to a program whenever the program is executed. It is used to avoid hard coding.


What is a command argument?

Command line arguments are provided at the time of running the program. Example: Suppose that your program needs input name and its value then running it from commandline(DOS prompt) you provide the values after the program name java xyz name JAX(name is name and value is jax)


What is man command?

The man command of the Linux operating system is the system's documentation pager. Each page argument given to man is normally the name of a program, utility or function. For example, to see the reference manual of the grep program: man grep


Write a program to find the product of two numbers using Halving and Doubling method?

i need this answer


Please someone explain you command line argument in C?

Command Line Arguments---- I am trying to explain each word one by oneCommand ------perform specific taskex. When CMD is typed in run window and then press ok button then open a black screen that is called command prompt.Command Line ------on command prompt where command is supplied that is called command line.using command prompt dos commands are executed and java program is also executed using command prompt.for executing java program command is supplied with given syntaxjava java_class_name argument1 argument2.........Java--- is a commandjava_class_name ---name of java file which you want to executeargument1 argument2 --- are the values passing to java application from out sidethese argument1 argument2 are stored in string array argument of main method


How do you compile and execute Java program in which we find the highest of any five numbers?

In the same way as you would compile and execute any other Java program. Compile: use the "javac" command. Or use the built-in "compile" command in your favorite IDE. Execute: Use the "java" command. Or use the built-in "run" command in your favorite IDE.


What is the command to compile jre6 program?

It is 'Java program' to be precise, and the command is: 'javac sourcefilename.java'


What is the name for the black screen with numbers and letters when a computer is booted?

Its called the command prompt Type command prompt into the help and support program that comes with windows and it will give you a link to open it.


What is command to compiler java program?

The command is "javac".


Instruction that causes a program to perform a specific action?

Command


How do you start the display program in Linux from the command line?

the command "display" brings up the ImageMagick program.


What is c program to calculate product of all even numbers from entered number down to 1?

c is programming laungage