1 Answer

answered by
Because Java is an object-oriented programming language, everything in Java begins with a class. So, when you are running a Java program, you are mainly running a class.

Let's look at the example below to know how to write Java codes so that it will run without any error.

The main() method is where the program starts running. No matter how big the program is you'll have to be a main() method to get started writing the statement.

public class HelloWorld {
public static void main (String[] args) {
System.out.println(“I Rule!”);
System.out.println(“Hello World”);
0 votes