Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

1 like 0 dislike
122 views
by The go-to Tester (344 points)
How can we execute a simple program in Java programming Language

1 Answer

0 like 0 dislike
by Master (1.2k points)
selected by
 
Best answer

Java uses public static void main as an entry point.

Create a Java file that has the above function.

E.g. file is given below.

/* HelloWorld.java
 */

public class HelloWorld
{
	public static void main(String[] args) {
		System.out.println("Hello World!");
	}
}

Now compile the above code as given below.

javac HelloWorld.java

Run the code as given below

java HelloWorld


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...