Java program to print the element using calling methods in the same class

Java program to print the element using calling methods in the same class. This application explains how a method can be called from within a single class. You must first create a class called ‘Main’ within which you will call the main() method in this application. This main() method also calls the Method1() and Method2() methods (). You may now refer to this as a method definition that makes a call to another set of methods. This program will help you how to call a method in java from the same class. 

public class Main
{
public static void main(String[] args)
{
Method1();
Method2();
}
public static void Method1()
{
System.out.println("Welcome to inlarn");
}
public static void Method2()
{
Method1();
}
}

Output:

Welcome to inlarn

Welcome to inlarn