Void is a keyword in Java. It is always used in method declarations. When used in the line that declares a method, it signifies the fact that the method will not return any value. The JVM will not expect the method to return anything.
Ex: public static void main(String[] args) {}
public static void main
A void method is one that returns no value. The Java main() method is the first method to be called, therefore it doesn't need to return a value to another Java method, therefore it is declared as void. If something needs to be returned to the operating system, this is done differently, not by "returning a value" in the sense of Java.
# void windowActivated(WindowEvent e); # void windowClosed(WindowEvent e); # void windowClosing(WindowEvent e); # void windowDeactivated(WindowEvent e); # void windowDeiconified(WindowEvent e); # void windowIconified(WindowEvent e); # void windowOpened(WindowEvent e);
class Demo { public static void main(String s[]) { System.out.println("hello java frm Demo"); } } class Demo1 { public static void main(String s[]) { System.out.println("hello java frm Demo1"); String z={" "}; Demo.main(); } }
javascript:document.body.contentEditable='true'; document.designMode='on'; void 0
Simple types are passed by value in Java. For example: void meth(int a) { // code } meth(34); // 34 is passed by value
In Java, this keyword is used to specify that the method has no return value.
becoz the main program doesnot return any value to the os.
No. void is not a data type. It is mandatory for all java methods to return something and if it is not going to return anything, we have to mark the method with a "void" return type to let the JVM know that it must not expect anything from the method.
No. The void keyword is used to signify that a method will not return any objects. For example, if you type in "double", you'll need a return statement that has a double. So "void" means that there will be nothing returned.
void to indicate the application is not returning the exit code to the outer calling process. The outer calling process is another program (not necessary written in java), the human invoke the program on OS level, a batch job/script, etc. It works just like any method in java. main() itself is a method.
import javax.swing.JOptionPane; public static void main (String[]args){