Table of Contents
In this tutorial, we will discuss the concept of Java class and the main method.
In this post, we are going to learn how to create Java class and main method
Explanation of Java class and the main method
In the above code example in Java, We are using java main method, each word have different meanings and purpose of the main method in Java
A class declared by class keyword in java. The class body is enclosed between curly braces. The data members methods constructor and object are declared Between open and end curly braces in the class
The data member or variable declared two types
it is an Access modifier, which defines who can access this method.public is a reserved word means that this Method will be accessible by any other class or anyone
it is a keyword allows the main() method to be called before any objects of the class have been created
it is a reserved word in java, which is known as a return type and all methods are required to have any one return type. But The void keyword denotes that this method never returns a value
it is the name of the method , This method name is the starting point of the program
it is the parameter to the main method
Suggested for you
Oop concept class object and method in Java
Multiply two numbers in Java using scanner| 5 different ways In this article, we will…
5 Different ways to Divide two numbers in Java using scanner In this article, we…
Learn 8 Ways to Subtract Two Numbers Using Methods in Java In this article, we…
10 ways to subtract two numbers in Java In this article, we will discuss the…
Java Code Examples – Multiply Two Numbers in 5 Easy Ways In this article, we…
How to Divide two numbers in Java| 5 different ways In this article, we will…
This website uses cookies.