answersLogoWhite

0

How do you execute this program in java?

Updated: 8/20/2019
User Avatar

Wiki User

11y ago

Best Answer

Any program before execution, you need to compile it. Let your file name be trial.java.

Syntax for compiling:


javac trial.java


Syntax for execution:


java trial


User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you execute this program in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can we execute java program without main function?

no


How do you execute a Java program?

You can run a Java application from the command line using "java <name of the class>"


What is the name of the command to run a java program?

javausage: java path\FooBar will execute path\FooBar.class


Can java program can be written without main?

No, main() class is required to execute the program as that's the starting point of the program.


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.


How do you compile and execute a java program which finds out the highest of any five numbers?

it will be destroyed.


What is the default program to open a jar file to execute a program?

You can open jar files with command prompt, Winrar or java.


Differentiate Java applet and Java servlet?

Java Applet is an application designed to transmit on internet to execute on java compatible browsers. Java Servlet is a server side program used to provide services to clients.


Why it is not possible to execute java program on machine which does not have JVM installed on it?

when a java program is compiled it is converted into a non executable code which is byte code, and this byte code can only be interpreted by JVM. so a java program can't be executed on a machine which doesn't have JVM installed on it.


Can the Java Virtual Machine execute only Java byte code?

Yes. Note, however, that does not limit the language in which a program is written to Java. There are a number of languages designed to run in the JVM and the number is growing. See https://en.wikipedia.org/wiki/List_of_JVM_languagesfor reference.


Why java execute with high performance?

I think java is object oriented language thats why that execute with high performance.


What mean by multithreaded program?

A multithreaded program is one that has multiple threads in execution. They may execute parallel to one another or totally without relation to one another. In Java you can create multithreaded programs using Java threads.