java void method code example

Example 1: java main method

public static void main(String args[]){}

Example 2: java how to define a function

//declare a function like this:
void function(int parameter1)
{
	//function body
}
//call the function like this:
function(1);

Example 3: what is void in java

Difference between void and return method
Void Method:
The "void" return type means that this
method doesn't have a return type.
It is mostly used for printing result 
to console

Example 4: void function

public void Yourvoidname()
{
	//Whatever you want to happen when your void is called
}


//somewhere else in your script, for example start()
void Start()
{
	Yourvoidname();
    //when the start function is called(first frame) your void will be called
}