Answers for "void in java"

2

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
}
Posted by: Guest on November-18-2020
1

void method java

int a = 20;
int b = 20;
public static void sum(){ // Void Method
  System.out.println(a + b);
}
public static int sum(){ // Return Function
  return a + b;
}
Posted by: Guest on June-18-2021
0

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
Posted by: Guest on January-05-2021
-2

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
 
Return Method:
This other method on the other hand,
returns a String. This means that you can
use the returned value in your code for
further processing.I guess good examples
of such methods are "getters".
Posted by: Guest on January-05-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language